Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Relax forbidden header restrictions for non-browser runtimes #19

Merged
merged 3 commits into from
Aug 16, 2023

Conversation

andreubotella
Copy link
Member

@andreubotella andreubotella commented Mar 7, 2023

Web browsers treat certain request and response headers as forbidden –forbidden request headers are impossible to set in requests, and forbidden response headers are always filtered off of even basic filtered response (i.e. responses for same-origin fetches).

While some of these forbidden request headers make sense generally (for example, Date, Host, Transfer-Encoding), others don't make sense for implementers that don't support CORS or cookies. And the only forbidden response headers (Set-Cookie and Set-Cookie2) only make sense for implementers that support cookies.

To allow different kinds of implementers with different requirements, this change adds a "conformance classes" section defining support for CORS and cookies. It then changes the definitions of forbidden request and response headers to depend on the user agent's conformance classes.

Web browsers treat certain request and response headers as forbidden
–forbidden request headers are impossible to set in requests, and
forbidden response headers are always filtered off of even basic
filtered response (i.e. responses for same-origin fetches).

While some of these forbidden request headers make sense generally
(for example, `Date`, `Host`, `Transfer-Encoding`), others don't make
sense for implementers that don't support CORS or cookies. And the
only forbidden response headers (`Set-Cookie` and `Set-Cookie2`) only
make sense for implementers that support cookies.

To allow different kinds of implementers with different requirements,
this change adds a "conformance classes" section defining support for
CORS and cookies. It then changes the definitions of forbidden request
and response headers to depend on the user agent's conformance
classes.
@andreubotella
Copy link
Member Author

Should Set-Cookie be a forbidden request header for all implementers?

fetch.bs Outdated Show resolved Hide resolved
fetch.bs Show resolved Hide resolved
fetch.bs Outdated Show resolved Hide resolved
andreubotella and others added 2 commits July 6, 2023 16:27
Co-authored-by: Ethan Arrowood <[email protected]>
Co-authored-by: Ethan Arrowood <[email protected]>
@Ethan-Arrowood Ethan-Arrowood merged commit 8f994ff into main Aug 16, 2023
@Ethan-Arrowood Ethan-Arrowood deleted the header-filtering branch August 16, 2023 21:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants