mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
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>
This commit is contained in:
committed by
Gopher Robot
parent
f8411da775
commit
296f09aa38
@@ -2192,7 +2192,7 @@ func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp requestParam) (*r
|
||||
tlsState = sc.tlsState
|
||||
}
|
||||
|
||||
needsContinue := rp.header.Get("Expect") == "100-continue"
|
||||
needsContinue := httpguts.HeaderValuesContainsToken(rp.header["Expect"], "100-continue")
|
||||
if needsContinue {
|
||||
rp.header.Del("Expect")
|
||||
}
|
||||
|
||||
@@ -2332,7 +2332,7 @@ func TestServer_Response_Automatic100Continue(t *testing.T) {
|
||||
}, func(st *serverTester) {
|
||||
st.writeHeaders(HeadersFrameParam{
|
||||
StreamID: 1, // clients send odd numbers
|
||||
BlockFragment: st.encodeHeader(":method", "POST", "expect", "100-continue"),
|
||||
BlockFragment: st.encodeHeader(":method", "POST", "expect", "100-Continue"),
|
||||
EndStream: false,
|
||||
EndHeaders: true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user