Repository navigation
Copy metadata header values into each request - #185
Open
bensynapse wants to merge 1 commit into
Open
bensynapse wants to merge 1 commit into
bensynapse wants to merge 1 commit into
Conversation
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.
I run Live Tennis API.
NewRequest now copies metadata header values. Editing one request no longer changes its context metadata or another request.
The old assignment shared slice storage across requests. Concurrent edits to separate requests could race. Lowercase header names and nil or empty values keep their existing behavior.
I added tests for request isolation, context isolation and concurrent edits to separate requests. An HTTP test checks the headers received by a local server.
The project checks pass on Go 1.24.0 and 1.25.0 in Docker.
I ran
go vet ./...,go test -v ./...,go test -race ./...andgo build ./....All 188 tests and subtests pass. The six new cases also pass 50 race runs.
Four regression cases fail before the fix, including the HTTP test and a data race.
The optional golint step reports seven findings in untouched files.
The first Go 1.25 race run reported a premature response, then timed out in TestE2EDraining.
Fresh full race runs passed on this branch and untouched upstream.