mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision 132d12daea699ce266324e79eecbe59b10e56502
This commit is contained in:
parent
527d874bc1
commit
fe00a63040
1004 changed files with 18598 additions and 92770 deletions
|
@ -1,3 +1,5 @@
|
|||
// META: script=/common/utils.js
|
||||
|
||||
// Helpers that return headers objects with a particular guard
|
||||
function headersGuardNone(fill) {
|
||||
if (fill) return new Headers(fill);
|
||||
|
@ -58,3 +60,31 @@ test(() => {
|
|||
assert_false(headers.has('Range'));
|
||||
}, `Privileged header not allowed for guard type: request-no-cors`);
|
||||
|
||||
promise_test(async () => {
|
||||
const wavURL = new URL('resources/long-wav.py', location);
|
||||
const stashTakeURL = new URL('resources/stash-take.py', location);
|
||||
|
||||
function changeToken() {
|
||||
const stashToken = token();
|
||||
wavURL.searchParams.set('accept-encoding-key', stashToken);
|
||||
stashTakeURL.searchParams.set('key', stashToken);
|
||||
}
|
||||
|
||||
const rangeHeaders = [
|
||||
'bytes=0-10',
|
||||
'foo=0-10',
|
||||
'foo',
|
||||
''
|
||||
];
|
||||
|
||||
for (const rangeHeader of rangeHeaders) {
|
||||
changeToken();
|
||||
|
||||
await fetch(wavURL, {
|
||||
headers: { Range: rangeHeader }
|
||||
});
|
||||
|
||||
const response = await fetch(stashTakeURL);
|
||||
assert_equals(await response.json(), 'identity', `Expect identity accept-encoding if range header is ${JSON.stringify(rangeHeader)}`);
|
||||
}
|
||||
}, `Fetch with range header will be sent with Accept-Encoding: identity`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue