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

Relax forbidden header restrictions for non-browser runtimes - #19

Merged
Ethan-Arrowood merged 3 commits into
mainfrom
header-filtering
Aug 16, 2023
Merged

Ethan-Arrowood merged 3 commits into
mainfrom
header-filtering

Conversation

@andreubotella

@andreubotella andreubotella commented Mar 7, 2023 •

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

Comment thread fetch.bs Resolved
Comment thread fetch.bs Resolved
Comment thread fetch.bs 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

This branch was successfully deployed

1 active deployment
Preview — ba7f4394 Deployed Jul 6, 2023 by deno-deploy[bot]
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