Skip to content

fix(mcp): do not offer a response body for redirect responses - #43977

Closed
nancy (nancy6547) wants to merge 2 commits into
microsoft:mainfrom
nancy6547:fix/mcp-redirect-body-hint
Closed

nancy (nancy6547) wants to merge 2 commits into
microsoft:mainfrom
nancy6547:fix/mcp-redirect-body-hint

Conversation

@nancy6547

Copy link
Copy Markdown

Fixes #43976

browser_network_request showed the part="response-body" hint for 3xx responses. Playwright never exposes the body of a redirect response (Response body is unavailable for redirect responses), so the follow-up call returned nothing.

canHaveResponseBody() now treats every 3xx status as having no body (it already covered 304).

Test: added browser_network_request does not offer a response body for a redirect in tests/mcp/network.spec.ts. It fails on main and passes with the fix. npm run ctest-mcp network passes (17 tests).

Updated the logic to check for response body availability based on HTTP status codes, clarifying that 3xx redirects do not expose a body.

Signed-off-by: nancy <singhnancy2004@gmail.com>
Signed-off-by: nancy <singhnancy2004@gmail.com>
@nancy6547

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

[Bug]: MCP browser_network_request suggests reading the response body of a redirect

2 participants