Skip to content

Commit

Permalink
fix(storage): fix routing header for writes
Browse files Browse the repository at this point in the history
This fixes several integration tests that were broken since
GCS started enforcing new formatting. Only writes are affected;
for other calls, the GAPIC handles the routing annotation.

Fixes googleapis#8142
Fixes googleapis#8143
Fixes googleapis#8144
Fixes googleapis#8145
Fixes googleapis#8149
  • Loading branch information
tritone committed Jun 21, 2023
1 parent cdfd268 commit 0ba90e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ func (w *gRPCWriter) uploadBuffer(recvd int, start int64, doneReading bool) (*st
// The first message on the WriteObject stream must either be the
// Object or the Resumable Upload ID.
if first {
ctx := gapic.InsertMetadata(w.ctx, metadata.Pairs("x-goog-request-params", "bucket="+url.QueryEscape(w.bucket)))
ctx := gapic.InsertMetadata(w.ctx, metadata.Pairs("x-goog-request-params", fmt.Sprintf("bucket=projects/_/buckets/%s", url.QueryEscape(w.bucket))))
w.stream, err = w.c.raw.WriteObject(ctx)
if err != nil {
return nil, 0, false, err
Expand Down

0 comments on commit 0ba90e4

Please sign in to comment.