-
Notifications
You must be signed in to change notification settings - Fork 1k
add custom headers on initial _startOrAuth call #318
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
add custom headers on initial _startOrAuth call #318
Conversation
This fix for |
@ihrpr Could you please help with the merge? Thanks! |
Update README requirement node js version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @anthonjn, a much needed update indeed! Suggested a slight refactor :-)
Missed the first comment notification, thanks @ochafik for merging! |
Ensure that custom headers provided in
this._requestInit?.headers
are included in the initial call to the/sse
endpoint.Motivation and Context
Fixes #317, where custom headers (e.g.
Host
,X-*
) were not sent in the initial/sse
request, but were correctly sent in/messages
. This is needed for MCP servers behind proxies that rely on these headers.This PR aligns the behavior of the
/sse
request withsend()
by ensuring that all custom headers (when provided) are forwarded appropriately.How Has This Been Tested?
/sse
request.Breaking Changes
No
Types of changes
Checklist
Additional context
N/a