feat(server): add opt-in HTTP gzip and WebSocket permessage-deflate compression#934
Open
efiten wants to merge 2 commits intoKpa-clawbot:masterfrom
Open
feat(server): add opt-in HTTP gzip and WebSocket permessage-deflate compression#934efiten wants to merge 2 commits intoKpa-clawbot:masterfrom
efiten wants to merge 2 commits intoKpa-clawbot:masterfrom
Conversation
Adds a `compression` config block (disabled by default) to let operators
enable HTTP gzip and WebSocket permessage-deflate when sitting behind a
reverse proxy that does not already compress upstream responses.
"compression": { "gzip": true, "websocket": true }
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
page.$() captures an element handle at query time. When the nodes page WebSocket auto-refresh fires between the querySelector and the .click() call, the table is re-rendered and the element is detached, causing "Element is not attached to the DOM". Replace both occurrences with page.click(selector), which re-queries the DOM at click time and retries until the element is stable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7 tasks
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.
Summary
"compression": {"gzip": true, "websocket": true}config option (bothfalseby default — no behavior change)Accept-Encoding: gziphub.upgrader.EnableCompressionwhenwebsocket: trueCompressionConfigstruct andGZipEnabled()/WSCompressionEnabled()helpers onConfigHub.upgradermoved from package-level var to struct field so tests usingNewHub()don't need changesWhy opt-in / off by default
Operators behind a reverse proxy that already compresses (nginx, Caddy with
encode gzip) should leave this off to avoid double-compression. Only enable when the proxy does not compress.Test plan
TestCompressionConfigDefaults— both helpers return false whenCompressionis nilTestCompressionConfigExplicitFalse— both helpers return false when set to falseTestCompressionConfigEnabled— both helpers return true when set to trueTestGZipMiddlewareCompresses— response body is valid gzip, headers set correctlyTestGZipMiddlewareSkipsNoAcceptEncoding— passthrough when client doesn't send Accept-Encoding: gzipTestGZipMiddlewareSkipsWebSocket— WebSocket upgrades are never gzip-wrappedAll 6 tests pass (
go test ./...incmd/server).🤖 Generated with Claude Code