Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js

Issue 2633423003: Leave out empty-valued Access-Control-Request-Headers: on preflights. (Closed)
Patch Set: explicitly include safe headers in the (test) request Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/cors-preflight2.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var SCOPE = BASE_ORIGIN + 1 var SCOPE = BASE_ORIGIN +
2 '/fetch/resources/thorough-iframe.html?' + TEST_OPTIONS; 2 '/fetch/resources/thorough-iframe.html?' + TEST_OPTIONS;
3 var IFRAME_ORIGIN = BASE_ORIGIN; 3 var IFRAME_ORIGIN = BASE_ORIGIN;
4 var BASE_URL = BASE_ORIGIN + 4 var BASE_URL = BASE_ORIGIN +
5 '/serviceworker/resources/fetch-access-control.php?'; 5 '/serviceworker/resources/fetch-access-control.php?';
6 var OTHER_BASE_URL = OTHER_ORIGIN + 6 var OTHER_BASE_URL = OTHER_ORIGIN +
7 '/serviceworker/resources/fetch-access-control.php?'; 7 '/serviceworker/resources/fetch-access-control.php?';
8 var BASE_URL_WITH_USERNAME = BASE_URL.replace('://', '://user@'); 8 var BASE_URL_WITH_USERNAME = BASE_URL.replace('://', '://user@');
9 var OTHER_BASE_URL_WITH_USERNAME = OTHER_BASE_URL.replace('://', '://user@'); 9 var OTHER_BASE_URL_WITH_USERNAME = OTHER_BASE_URL.replace('://', '://user@');
10 var BASE_URL_WITH_PASSWORD = BASE_URL.replace('://', '://user:pass@'); 10 var BASE_URL_WITH_PASSWORD = BASE_URL.replace('://', '://user:pass@');
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 if (params['headers'] === 'CUSTOM') { 313 if (params['headers'] === 'CUSTOM') {
314 init['headers'] = {'X-ServiceWorker-Test': 'test'}; 314 init['headers'] = {'X-ServiceWorker-Test': 'test'};
315 } else if (params['headers'] === 'CUSTOM2') { 315 } else if (params['headers'] === 'CUSTOM2') {
316 init['headers'] = [['X-ServiceWorker-Test', 'test2'], 316 init['headers'] = [['X-ServiceWorker-Test', 'test2'],
317 ['X-ServiceWorker-ua', 'test4'], 317 ['X-ServiceWorker-ua', 'test4'],
318 ['X-ServiceWorker-V', 'test6'], 318 ['X-ServiceWorker-V', 'test6'],
319 ['X-ServiceWorker-s', 'test1'], 319 ['X-ServiceWorker-s', 'test1'],
320 ['X-ServiceWorker-Test', 'test3'], 320 ['X-ServiceWorker-Test', 'test3'],
321 ['X-ServiceWorker-U', 'test5']]; 321 ['X-ServiceWorker-U', 'test5']];
322 } else if (params['headers'] === 'SAFE') {
323 init['headers'] = [['Accept', '*/*'],
324 ['Accept-Language', 'en-us,de'],
325 ['Content-Language', 'en-us'],
326 ['Content-Type', 'text/plain'],
327 ['Save-data', 'on']];
322 } else if (params['headers'] === '{}') { 328 } else if (params['headers'] === '{}') {
323 init['headers'] = {}; 329 init['headers'] = {};
324 } 330 }
325 return init; 331 return init;
326 } 332 }
327 333
328 function headersToArray(headers) { 334 function headersToArray(headers) {
329 var ret = []; 335 var ret = [];
330 336
331 // Workaround for Firefox. iterable is not implemented yet. 337 // Workaround for Firefox. iterable is not implemented yet.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 444
439 function executeTests(test_targets) { 445 function executeTests(test_targets) {
440 for (var i = 0; i < test_targets.length; ++i) { 446 for (var i = 0; i < test_targets.length; ++i) {
441 promise_test( 447 promise_test(
442 function(counter, t) { 448 function(counter, t) {
443 return executeTest(test_targets[counter]); 449 return executeTest(test_targets[counter]);
444 }.bind(this, i), 450 }.bind(this, i),
445 "executeTest-" + i); 451 "executeTest-" + i);
446 } 452 }
447 } 453 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/cors-preflight2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698