Skip to content
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

fix(httpreplay): ignore GCS header by default #8260

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions httpreplay/cmd/httpr/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ func start(modeFlag, filename string) (*exec.Cmd, *http.Transport, string, error
modeFlag,
filename,
"-debug-headers",
"-ignore-header", "X-Goog-Api-Client",
"-ignore-header", "X-Goog-Gcs-Idempotency-Token",
)
if err := cmd.Start(); err != nil {
return nil, nil, "", err
Expand Down
4 changes: 0 additions & 4 deletions httpreplay/httpreplay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ func TestIntegration_RecordAndReplay(t *testing.T) {
if err != nil {
t.Fatal(err)
}
rec.RemoveRequestHeaders("X-Goog-Api-Client")
rec.RemoveRequestHeaders("X-Goog-Gcs-Idempotency-Token")

hc, err := rec.Client(ctx, option.WithTokenSource(
testutil.TokenSource(ctx, storage.ScopeFullControl)))
Expand All @@ -86,8 +84,6 @@ func TestIntegration_RecordAndReplay(t *testing.T) {
if err != nil {
t.Fatal(err)
}
rep.IgnoreHeader("X-Goog-Api-Client")
rep.IgnoreHeader("X-Goog-Gcs-Idempotency-Token")
defer rep.Close()
hc, err = rep.Client(ctx)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions httpreplay/internal/proxy/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ var (
"Via",
"X-Forwarded-*",
// Google-specific
"X-Cloud-Trace-Context", // OpenCensus traces have a random ID
"X-Goog-Api-Client", // can differ for, e.g., different Go versions
"X-Cloud-Trace-Context", // OpenCensus traces have a random ID
"X-Goog-Api-Client", // can differ for, e.g., different Go versions
"X-Goog-Gcs-Idempotency-Token", // Used by Cloud Storage
}

defaultRemoveBothHeaders = []string{
Expand Down