Skip to content

Commit c65a279

Browse files
committed
linting: fix bodyclose, canonicalheader in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent bd50474 commit c65a279

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

spdy_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func TestSpdyStreams(t *testing.T) {
8181
}
8282

8383
headers := http.Header{
84-
"TestKey": []string{"TestVal"},
84+
"Test-Key": []string{"TestVal"},
8585
}
8686
sendErr := stream.SendHeader(headers, false)
8787
if sendErr != nil {
@@ -94,7 +94,7 @@ func TestSpdyStreams(t *testing.T) {
9494
if len(receiveHeaders) != 1 {
9595
t.Fatalf("Unexpected number of headers:\nActual: %d\nExpecting:%d", len(receiveHeaders), 1)
9696
}
97-
testVal := receiveHeaders.Get("TestKey")
97+
testVal := receiveHeaders.Get("Test-Key")
9898
if testVal != "TestVal" {
9999
t.Fatalf("Wrong test value:\nActual: %q\nExpecting: %q", testVal, "TestVal")
100100
}
@@ -875,10 +875,11 @@ func TestFramingAfterRemoteConnectionClosed(t *testing.T) {
875875
rt := &roundTripper{}
876876
client := &http.Client{Transport: rt}
877877

878-
_, err = client.Do(req)
878+
r, err := client.Do(req)
879879
if err != nil {
880880
t.Fatalf("unexpected error from client.Do: %s", err)
881881
}
882+
defer func() { _ = r.Body.Close() }()
882883

883884
conn, err := NewConnection(rt.conn, false)
884885
if err != nil {

0 commit comments

Comments
 (0)