`useEventSource` is missing header configuration
quando1910 opened this issue · comments
Quan Do commented
Clear and concise description of the problem
As a developer using useEventSource
, I want to have headers
options for useEventSource, so that we can add an Authorization token for the event source in some cases.###
Suggested solution
Add headers?: { [name: string]: string };
in interface EventSourceInit
Then pass headers when execute new EventSource
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
transtone commented
why completed it?
=========
use @microsoft/fetch-event-source
/ fetch
when need add header.
https://blackbing.medium.com/淺談-server-sent-events-9c81ef21ca8e