| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -124,7 +124,8 @@ async def test_streamable_http_security_get_request() -> None: | |
| assert response.text == "Invalid Host header" | ||
|
|
||
| response = await client.get("/", headers={"Accept": "text/event-stream", "Host": "127.0.0.1"}) | ||
| # An allowed host passes security and fails on session validation instead. | ||
| assert response.status_code == 400 | ||
| # An allowed host passes security; a session-less GET the server cannot serve | ||
| # as an SSE stream then gets the spec-mandated 405 (not 400). | ||
| assert response.status_code == 405 | ||
|
Comment thread
Copy link
Copy Markdown
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityP2: The spec-mandated Allow: POST header returned with the 405 is not asserted. The implementation sets it (line 331 of _streamable_http_modern.py), but the test only checks status code and error message. Add assert response.headers.get("Allow") == "POST" to fully cover the spec-mandated behavior. Prompt for AI agentsCheck if this issue is valid — if so, understand the root cause and fix it. At tests/server/test_streamable_http_security.py, line 129:
<comment>The spec-mandated `Allow: POST` header returned with the 405 is not asserted. The implementation sets it (line 331 of `_streamable_http_modern.py`), but the test only checks status code and error message. Add `assert response.headers.get("Allow") == "POST"` to fully cover the spec-mandated behavior.</comment>
<file context>
@@ -124,7 +124,8 @@ async def test_streamable_http_security_get_request() -> None:
- assert response.status_code == 400
+ # An allowed host passes security; a session-less GET the server cannot serve
+ # as an SSE stream then gets the spec-mandated 405 (not 400).
+ assert response.status_code == 405
body = response.json()
- assert "Missing session ID" in body["error"]["message"]
</file context>
Sorry, something went wrong.
All reactions
|
||
| body = response.json() | ||
| assert "Missing session ID" in body["error"]["message"] | ||
| assert "Method Not Allowed" in body["error"]["message"] | ||
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityP1: A normal pre-initialize SSE probe now creates and retains a stateful session even though it is rejected. The session manager allocates and starts a transport before this handler returns 405, and the prescribed follow-up POST has no session ID, so it creates a different transport; with the default no idle timeout, the probe transport stays in _server_instances forever. Consider rejecting session-less GET probes before allocating a stateful transport (or explicitly terminating/removing the newly allocated transport) so this handshake path cannot accumulate orphan sessions.
Prompt for AI agentsSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.