Skip to content

Commit

Permalink
add TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
tritone committed Mar 20, 2023
1 parent 51129e9 commit 74e8e2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/gensupport/resumable.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader,
req.Header.Set("Content-Type", rx.MediaType)
req.Header.Set("User-Agent", rx.UserAgent)

// TODO(b/274504690): Consider dropping gccl-invocation-id key since it
// duplicates the X-Goog-Gcs-Idempotency-Token header (added in v0.115.0).
baseXGoogHeader := "gl-go/" + GoVersion() + " gdcl/" + internal.Version
invocationHeader := fmt.Sprintf("gccl-invocation-id/%s gccl-attempt-count/%d", rx.invocationID, rx.attempts)
req.Header.Set("X-Goog-Api-Client", strings.Join([]string{baseXGoogHeader, invocationHeader}, " "))
Expand Down
2 changes: 2 additions & 0 deletions internal/gensupport/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ func sendAndRetry(ctx context.Context, client *http.Client, req *http.Request, r
}

// Set retry metrics and idempotency headers for GCS.
// TODO(b/274504690): Consider dropping gccl-invocation-id key since it
// duplicates the X-Goog-Gcs-Idempotency-Token header (added in v0.115.0).
invocationHeader := fmt.Sprintf("gccl-invocation-id/%s gccl-attempt-count/%d", invocationID, attempts)
xGoogHeader := strings.Join([]string{invocationHeader, baseXGoogHeader}, " ")
req.Header.Set("X-Goog-Api-Client", xGoogHeader)
Expand Down

0 comments on commit 74e8e2c

Please sign in to comment.