-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(storage): remove x-goog-api-client header merging from invoke #10514
Conversation
BrennaEpp
commented
Jul 6, 2024
- go version must still be included since uploads do not always include the version otherwise (other operations will see the value repeated, however)
- xml still has to do the merging
- grpc had a bug where the ctx from invoke was not being used so the header wouldn't always be sent
- go version must still be included since uploads do not always include the version otherwise (other operations will see the value repeated, however) - xml still has to do the merging - grpc had a bug where the ctx from invoke was not being used so the header wouldn't always be sent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just needs a test.
storage/http_client.go
Outdated
@@ -860,9 +860,21 @@ func (c *httpStorageClient) newRangeReaderXML(ctx context.Context, params *newRa | |||
// Set custom headers passed in via the context. This is only required for XML; | |||
// for gRPC & JSON this is handled in the GAPIC and Apiary layers respectively. | |||
ctxHeaders := callctx.HeadersFromContext(ctx) | |||
|
|||
for k, vals := range ctxHeaders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test for this logic? Could either use a mock transport, or factor out the header logic into a separate func for easy testing.