Skip to content

Derive AutoSession cookie security from page request - #413

Merged
linkdata merged 3 commits into
mainfrom
fix/autosession-secure-page
Sep 25, 2026
Merged

linkdata merged 3 commits into
mainfrom
fix/autosession-secure-page

Conversation

@linkdata

@linkdata linkdata commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

AutoSession's cookie Secure flag follows the initial page request's scheme, including trusted forwarding headers. The WebSocket request supplies the client IP for Session binding.

A real-WebSocket regression test covers HTTP and HTTPS pages, including mismatched forwarded schemes in either direction. An HTTPS page whose upgrade request lacks the scheme header returned a cookie without Secure before this change.

Fixes #400.

Validation

  • go generate ./...
  • go test -race ./...
  • go test ./...
  • go vet ./...
  • CI-pinned staticcheck ./...
  • golangci-lint run
  • gosec -quiet ./...
  • go build ./...
  • gofumpt -l jaws.go request.go request_test.go

@linkdata
linkdata merged commit 6297c09 into main Sep 25, 2026
7 checks passed
@linkdata
linkdata deleted the fix/autosession-secure-page branch September 25, 2026 18:26
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.

Needs a check: AutoSession derives cookie Secure from the upgrade request

1 participant