Skip to content

Commit fa30cc3

Browse files
committed
fix(config_test): use canonical HTTP header names in expectedHeaders
Go's http.Header canonicalizes header names (e.g., X-GitHub-Api-Version becomes X-Github-Api-Version). The test's unexpected header check was failing because it compared canonical names against non-canonical keys in the expectedHeaders map. Signed-off-by: Mike Ball <[email protected]>
1 parent 4fe0b75 commit fa30cc3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

github/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func TestPreviewHeaderInjectorTransport_RoundTrip(t *testing.T) {
390390
existingHeaders: map[string]string{},
391391
expectedHeaders: map[string]string{
392392
"Accept": "application/vnd.github.v3+json",
393-
"X-GitHub-Api-Version": "2022-11-28",
393+
"X-Github-Api-Version": "2022-11-28",
394394
},
395395
expectRoundTripCall: true,
396396
},
@@ -406,7 +406,7 @@ func TestPreviewHeaderInjectorTransport_RoundTrip(t *testing.T) {
406406
},
407407
expectedHeaders: map[string]string{
408408
"Accept": "application/json,application/vnd.github.v3+json",
409-
"X-GitHub-Api-Version": "2021-01-01,2022-11-28",
409+
"X-Github-Api-Version": "2021-01-01,2022-11-28",
410410
},
411411
expectRoundTripCall: true,
412412
},

0 commit comments

Comments
 (0)