Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
1 check passed
@Ethan-Arrowood Ethan-Arrowood deleted the header-filtering branch August 16, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants