Skip to content

fix(proxyFetch): extract method, headers, body from Request inputs#1223

Open
Will-hxw wants to merge 1 commit intomodelcontextprotocol:mainfrom
Will-hxw:fix/proxyfetch-request-semantics
Open

fix(proxyFetch): extract method, headers, body from Request inputs#1223
Will-hxw wants to merge 1 commit intomodelcontextprotocol:mainfrom
Will-hxw:fix/proxyfetch-request-semantics

Conversation

@Will-hxw
Copy link
Copy Markdown

Summary

  • Extract method, headers, and body from Request object inputs in createProxyFetch(); init parameter takes precedence when both Request and init are provided

Why

Issue #1207: createProxyFetch() only passes url when given a Request object, dropping method, headers, and body semantics.

Validation

  • TypeScript compilation passed
  • Branch pushed to fork

When createProxyFetch() is called with a Request object instead of (url, init),
the original implementation only forwarded request.url and dropped method, headers,
and body. This caused proxy payloads to lose request semantics.

Now extracts method, headers, and body from Request inputs, with init
still able to override those values when provided.

Fixes modelcontextprotocol#1207
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.

1 participant