Skip to content

fix: apply requestBuilder headers when sending rpc messages #96

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

Merged
merged 2 commits into from
May 13, 2025

Conversation

dead8309
Copy link
Contributor

@dead8309 dead8309 commented May 4, 2025

fixes: #63

Adds the missing requestBuilder call to send function

Motivation and Context

Client doesn't send Auth headers when sending a rpc message

How Has This Been Tested?

logs:

2025-05-05 01:07:32.569 12997-13028            V  REQUEST: https://[REDACTED]/sse/message?sessionId=c28e21031144b7b85616b23d6caf8c7feb1f88e88ad1beefb533b68060d3e236
                                                  METHOD: POST
                                                  COMMON HEADERS
                                                  -> Accept: application/json
                                                  -> Accept-Charset: UTF-8
                                                  -> Authorization: Bearer e41ef9271332d4732fb4f[REDACTED]
                                                  CONTENT HEADERS
                                                  -> Content-Length: 230
                                                  -> Content-Type: application/json
2025-05-05 01:07:32.594 12997-13028            D  tagSocket(114) with statsTag=0xffffffff, statsUid=-1
2025-05-05 01:07:33.097 12997-13055            V  RESPONSE: 202 Accepted
                                                  METHOD: POST
                                                  FROM: https://[REDACTED]/sse/message?sessionId=c28e21031144b7b85616b23d6caf8c7feb1f88e88ad1beefb533b68060d3e236
                                                  COMMON HEADERS
                                                  -> Access-Control-Allow-Origin: *
                                                  -> CF-RAY: 93aa74118ec0938b-BBI
                                                  -> Cache-Control: no-cache
                                                  -> Connection: keep-alive
                                                  -> Content-Length: 8
                                                  -> Content-Type: text/event-stream
                                                  -> Date: Sun, 04 May 2025 19:37:34 GMT

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@dead8309 dead8309 changed the title nit: apply requestBuilder headers when rpc messages nit: apply requestBuilder headers when sending rpc messages May 4, 2025
@dead8309 dead8309 changed the title nit: apply requestBuilder headers when sending rpc messages fix: apply requestBuilder headers when sending rpc messages May 4, 2025
Copy link
Contributor

@e5l e5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dead8309, thank you for the contribution! LGTM

@e5l e5l enabled auto-merge (squash) May 5, 2025 05:56
auto-merge was automatically disabled May 7, 2025 16:38

Head branch was pushed to by a user without write access

@e5l e5l enabled auto-merge (squash) May 13, 2025 13:34
@e5l e5l merged commit 782b525 into modelcontextprotocol:main May 13, 2025
1 check passed
@dead8309 dead8309 deleted the patch-1 branch May 13, 2025 15:15
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.

Request headers not applied to transport
2 participants