Commit f0396caf authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: add a test verifying header case preservation

Fixes #5022

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7712043
parent 5c667f36
......@@ -391,6 +391,30 @@ var reqWriteTests = []reqWriteTest{
"Host: x.google.com\r\n" +
"User-Agent: Go 1.1 package http\r\n\r\n",
},
// Testing custom case in header keys. Issue 5022.
{
Req: Request{
Method: "GET",
URL: &url.URL{
Scheme: "http",
Host: "www.google.com",
Path: "/",
},
Proto: "HTTP/1.1",
ProtoMajor: 1,
ProtoMinor: 1,
Header: Header{
"ALL-CAPS": {"x"},
},
},
WantWrite: "GET / HTTP/1.1\r\n" +
"Host: www.google.com\r\n" +
"User-Agent: Go 1.1 package http\r\n" +
"ALL-CAPS: x\r\n" +
"\r\n",
},
}
func TestRequestWrite(t *testing.T) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment