Skip to content

Commit

Permalink
Bug 1452562 [wpt PR 10348] - Allow range headers to pass through a se…
Browse files Browse the repository at this point in the history
…rvice worker, a=testonly

Automatic update from web-platform-testsAllow range headers to pass through a service worker (#10348)

Tests for whatwg/fetch#560

--

wpt-commits: fb6d16d92af29262b6137b79e61f0c4b136c6ac1
wpt-pr: 10348

UltraBlame original commit: 8b458f3d30b63afa745527bc31744f4971749224
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent bb445aa commit bf31664
Show file tree
Hide file tree
Showing 10 changed files with 3,929 additions and 1 deletion.
426 changes: 425 additions & 1 deletion testing/web-platform/meta/MANIFEST.json

Large diffs are not rendered by default.

398 changes: 398 additions & 0 deletions testing/web-platform/tests/fetch/range/general.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,398 @@
function
headersGuardNone
(
fill
)
{
if
(
fill
)
return
new
Headers
(
fill
)
;
return
new
Headers
(
)
;
}
function
headersGuardResponse
(
fill
)
{
const
opts
=
{
}
;
if
(
fill
)
opts
.
headers
=
fill
;
return
new
Response
(
'
'
opts
)
.
headers
;
}
function
headersGuardRequest
(
fill
)
{
const
opts
=
{
}
;
if
(
fill
)
opts
.
headers
=
fill
;
return
new
Request
(
'
.
/
'
opts
)
.
headers
;
}
function
headersGuardRequestNoCors
(
fill
)
{
const
opts
=
{
mode
:
'
no
-
cors
'
}
;
if
(
fill
)
opts
.
headers
=
fill
;
return
new
Request
(
'
.
/
'
opts
)
.
headers
;
}
const
headerGuardTypes
=
[
[
'
none
'
headersGuardNone
]
[
'
response
'
headersGuardResponse
]
[
'
request
'
headersGuardRequest
]
]
;
for
(
const
[
guardType
createHeaders
]
of
headerGuardTypes
)
{
test
(
(
)
=
>
{
let
headers
=
createHeaders
(
{
Range
:
'
foo
'
}
)
;
assert_equals
(
headers
.
get
(
'
Range
'
)
'
foo
'
)
;
headers
=
createHeaders
(
)
;
headers
.
append
(
'
Range
'
'
foo
'
)
;
assert_equals
(
headers
.
get
(
'
Range
'
)
'
foo
'
)
;
headers
=
createHeaders
(
)
;
headers
.
set
(
'
Range
'
'
foo
'
)
;
assert_equals
(
headers
.
get
(
'
Range
'
)
'
foo
'
)
;
}
Range
header
setting
allowed
for
guard
type
:
{
guardType
}
)
;
}
test
(
(
)
=
>
{
let
headers
=
headersGuardRequestNoCors
(
{
Range
:
'
foo
'
}
)
;
assert_false
(
headers
.
has
(
'
Range
'
)
)
;
headers
=
headersGuardRequestNoCors
(
)
;
headers
.
append
(
'
Range
'
'
foo
'
)
;
assert_false
(
headers
.
has
(
'
Range
'
)
)
;
headers
=
headersGuardRequestNoCors
(
)
;
headers
.
set
(
'
Range
'
'
foo
'
)
;
assert_false
(
headers
.
has
(
'
Range
'
)
)
;
}
Privileged
header
not
allowed
for
guard
type
:
request
-
no
-
cors
)
;
Loading

0 comments on commit bf31664

Please sign in to comment.