Skip to content

Commit 296f09a

Browse files
fraenkelgopherbot
authored andcommitted
http2: case insensitive handling for 100-continue
rfc 9110, section 10.1.1 states that the Expect field value is case-insensitive. Fixes golang/go#57824 Change-Id: Ie0e2662c58a2933087e0d35935c04ec61026a41d Reviewed-on: https://go-review.googlesource.com/c/net/+/463096 Auto-Submit: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
1 parent f8411da commit 296f09a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

http2/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp requestParam) (*r
21922192
tlsState = sc.tlsState
21932193
}
21942194

2195-
needsContinue := rp.header.Get("Expect") == "100-continue"
2195+
needsContinue := httpguts.HeaderValuesContainsToken(rp.header["Expect"], "100-continue")
21962196
if needsContinue {
21972197
rp.header.Del("Expect")
21982198
}

http2/server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ func TestServer_Response_Automatic100Continue(t *testing.T) {
23322332
}, func(st *serverTester) {
23332333
st.writeHeaders(HeadersFrameParam{
23342334
StreamID: 1, // clients send odd numbers
2335-
BlockFragment: st.encodeHeader(":method", "POST", "expect", "100-continue"),
2335+
BlockFragment: st.encodeHeader(":method", "POST", "expect", "100-Continue"),
23362336
EndStream: false,
23372337
EndHeaders: true,
23382338
})

0 commit comments

Comments
 (0)