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

refactor: allow server-side headers #1649

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kikobeats
Copy link
Contributor

@Kikobeats Kikobeats commented Sep 14, 2022

Hello,

At Edge Runtime, we are patching the undici Request implementation to be more server-side friendly, allowing to pass connection header.

I guess connection and the rest of headers are forbidden to follow with fetch spec. Potentially there are more headers that should to be forbidden according to https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name

but since undici can be used in servers too, is it any chance to be less restrictive?

MDN is pointing something that could be key:

Modifying such headers is forbidden because the user agent retains full control over them.

Maybe setup user-agent: undefined could be the way to discriminate these headers in any way?

Related:

@ronag
Copy link
Member

ronag commented Sep 14, 2022

I'm not so sure about this. Need to think a bit.

@mcollina
Copy link
Member

I think the best avenue to discuss this is https://github.com/wintercg/fetch

@ronag
Copy link
Member

ronag commented Sep 16, 2022

I don't understand the use case. Most of these headers is something the user should not be touching or using. Do you have some examples?

@KhafraDev
Copy link
Member

This is needed if undici implements a WebSocket client.

        The request MUST contain an |Upgrade| header field whose value
        MUST include the "websocket" keyword.
        The request MUST contain a |Connection| header field whose value
        MUST include the "Upgrade" token.

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.

None yet

4 participants