add Cache-Control: no-store via security headers middleware - #3712
Closed
aydnOktay wants to merge 8 commits into
Closed
add Cache-Control: no-store via security headers middleware#3712aydnOktay wants to merge 8 commits into
aydnOktay wants to merge 8 commits into
Conversation
…ote even when local setup complete
…ure; synthesize remote reminder only in message layer
…move broken preloaded prompt block
teknium1
reviewed
Jul 12, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the focused security goal. The current middleware is still the correct live integration point: gateway/platforms/api_server.py:698-703 has no Cache-Control default and is installed by the server at gateway/platforms/api_server.py:4766-4767.
Problems
- The added
setdefaultdoes not cover streaming responses. Four current SSE constructors explicitly setCache-Control: no-cacheatgateway/platforms/api_server.py:2031,:2420,:2650, and:4516; those values remain unchanged. - The added
/v1/modelstest covers only a normal response, not those streaming paths. agent/skill_commands.pyand the CORS expose-header change are unrelated to the stated cache-control scope. The linked salvage PR #62759 also identifies the skill changes as drive-bys.
Suggested changes
- Keep this change API-header-only, set the intended cache directive on the four SSE response constructors too, and add streamed-response coverage.
Automated hermes-sweeper review.
| response = await handler(request) | ||
| for k, v in _SECURITY_HEADERS.items(): | ||
| response.headers.setdefault(k, v) | ||
| response.headers.setdefault("Cache-Control", "no-store") |
Contributor
There was a problem hiding this comment.
setdefault leaves existing Cache-Control: no-cache headers untouched. The API server has explicit SSE response headers, so this does not provide the PR's stated all-responses no-store guarantee; update and test those streaming header paths too.
Bartok9
pushed a commit
to Bartok9/hermes-agent
that referenced
this pull request
Aug 1, 2026
…e of NousResearch#3707/NousResearch#3712 by @aydnOktay) Rebuilt on latest main (Bartok9 hygiene 2026-08-01). Original: NousResearch#62759
Contributor
Author
|
Closing to concentrate review on a single linked product bug: #89979. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a secure default Cache-Control: no-store header to all API responses via the existing security_headers_middleware. This prevents intermediaries and browsers from persisting sensitive payloads, aligning with best practices and reducing data leakage risk. The change is minimal and low risk, and includes a focused unit test asserting the header is present on a simple GET /v1/models response