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

Is there a plan to add options for setting HTTP headers on EventSource? #3115

Closed
Uzlopak opened this issue Apr 13, 2024 Discussed in #3112 · 6 comments · Fixed by #3119
Closed

Is there a plan to add options for setting HTTP headers on EventSource? #3115

Uzlopak opened this issue Apr 13, 2024 Discussed in #3112 · 6 comments · Fixed by #3119

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Apr 13, 2024

Discussed in #3112

Originally posted by zbinlin April 13, 2024
Likes Websocket, we can adds a dispatcher option to EventSource constructor.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Apr 13, 2024

@KhafraDev

Your opinion on this request?

@KhafraDev
Copy link
Member

we should add it

@mertcanaltin
Copy link
Member

mertcanaltin commented Apr 14, 2024

I added a dispatcher in EventSource, how should I manage it, do we have certain rules? @Uzlopak @KhafraDev

@KhafraDev
Copy link
Member

The same way fetch and websocket implement it https://github.com/nodejs/undici?tab=readme-ov-file#undicifetchinput-init-promise

@mertcanaltin
Copy link
Member

I wonder if that's a good method
mertcanaltin@8f6cf8b

@KhafraDev
Copy link
Member

No, dispatcher should be added as an optional property in the eventsource options (second parameter) and I'm not sure if we need to add custom headers since it can be done with Agent. Also there is no step 11 that adds custom headers in the spec so all of those changes to comments should be undone.

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 a pull request may close this issue.

3 participants