forked from quic-go/quic-go
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/protocol"
|
||||
@@ -48,7 +49,7 @@ func (w *responseWriter) WriteHeader(status int) {
|
||||
enc.WriteField(hpack.HeaderField{Name: ":status", Value: strconv.Itoa(status)})
|
||||
|
||||
for k, v := range w.header {
|
||||
enc.WriteField(hpack.HeaderField{Name: k, Value: v[0]})
|
||||
enc.WriteField(hpack.HeaderField{Name: strings.ToLower(k), Value: v[0]})
|
||||
}
|
||||
|
||||
utils.Infof("Responding with %d", status)
|
||||
|
||||
@@ -44,9 +44,7 @@ var _ = Describe("Response Writer", func() {
|
||||
w.Header().Add("content-length", "42")
|
||||
w.WriteHeader(http.StatusTeapot)
|
||||
Expect(headerStream.Bytes()).To(Equal([]byte{
|
||||
0x0, 0x0, 0x14, 0x1, 0x4, 0x0, 0x0, 0x0, 0x5, 0x48, 0x3, 0x34, 0x31, 0x38,
|
||||
0x40, 0x8a, 0xbc, 0x7a, 0x92, 0x5a, 0x92, 0xb6, 0x72, 0xd5, 0x32, 0x67,
|
||||
0x2, 0x34, 0x32,
|
||||
0x0, 0x0, 0x9, 0x1, 0x4, 0x0, 0x0, 0x0, 0x5, 0x48, 0x3, 0x34, 0x31, 0x38, 0x5c, 0x2, 0x34, 0x32,
|
||||
}))
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user