Skip to content

Commit

Permalink
Enforce RequestInit enum values
Browse files Browse the repository at this point in the history
This makes the Fetch API more standards compliant by
enforcing the enum values in the RequestInit dictionary,
as this is not taken care of by the IDL bindings themselves.
This enforces the mode, credentials, cache, and redirect properties
of RequestInit.

R=yhirano@chromium.org, yoav@yoav.ws

Bug: 777116
Change-Id: I8db5fd991b5ffa039dc2f67b4d8f525647fbf915
Reviewed-on: https://chromium-review.googlesource.com/841270
Commit-Queue: Yoav Weiss <yoav@yoav.ws>
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541515}
  • Loading branch information
domfarolino authored and chromium-wpt-export-bot committed Mar 7, 2018
1 parent 2e16103 commit ab5b01b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions service-workers/service-worker/webvtt-cross-origin.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
url += '?url=' + get_host_info().HTTPS_REMOTE_ORIGIN + '/media/foo.vtt';
// Add '&mode' to tell the service worker to do a CORS request.
url += '&mode=cors';
// Add '&credentials=anonymous' to allow Access-Control-Allow-Origin=* so
// Add '&credentials=same-origin' to allow Access-Control-Allow-Origin=* so
// that CORS will succeed if the service approves it.
url += '&credentials=anonymous';
url += '&credentials=same-origin';
return load_track(url)
.then(result => {
assert_equals(result, 'load event');
Expand Down Expand Up @@ -142,9 +142,9 @@
url += '?url=' + encodeURIComponent(redirector_url + encodeURIComponent(redirect_target));
// Add '&mode' to tell the service worker to do a CORS request.
url += '&mode=cors';
// Add '&credentials=anonymous' to allow Access-Control-Allow-Origin=* so
// Add '&credentials=same-origin' to allow Access-Control-Allow-Origin=* so
// that CORS will succeed if the server approves it.
url += '&credentials=anonymous';
url += '&credentials=same-origin';
return load_track(url)
.then(result => {
assert_equals(result, 'error event');
Expand All @@ -160,9 +160,9 @@
url += '?url=' + encodeURIComponent(redirector_url + encodeURIComponent(redirect_target));
// Add '&mode' to tell the service worker to do a CORS request.
url += '&mode=cors';
// Add '&credentials=anonymous' to allow Access-Control-Allow-Origin=* so
// Add '&credentials=same-origin' to allow Access-Control-Allow-Origin=* so
// that CORS will succeed if the server approves it.
url += '&credentials=anonymous';
url += '&credentials=same-origin';
return load_track(url)
.then(result => {
assert_equals(result, 'load event');
Expand Down

0 comments on commit ab5b01b

Please sign in to comment.