Skip to content

fix(signing): include repeated header values - #47

Open
bensynapse wants to merge 1 commit into
gin-contrib:masterfrom
bensynapse:fix-repeated-signature-headers
Open

bensynapse wants to merge 1 commit into
gin-contrib:masterfrom
bensynapse:fix-repeated-signature-headers

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

Requests signed with repeated headers currently fail authentication because the signing message includes only the first value. For example, two Cache-Control fields should produce cache-control: max-age=60, must-revalidate.

The signing message now joins header values in transmitted order with comma and space. This follows the draft's signature string rules.

Nine string cases and six real HTTP cases pass. Ten cases fail against the original code, including four HTTP requests that return 401 instead of 204.

The CI command go test -v -covermode=atomic -coverprofile=coverage.out passes on Go 1.26.0 and 1.27.1. Both versions also pass go test -race ./..., go build ./... and go vet ./.... The full make test command passes in the Go 1.26.3 container. make install-tools lint reports zero issues.

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.

1 participant