send priority in H2 request headers

is required by Google’s QUIC implementation
This commit is contained in:
Marten Seemann
2016-12-14 22:33:09 +07:00
parent dc05de3312
commit 4130c3de32
2 changed files with 2 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ func (w *requestWriter) WriteRequest(req *http.Request, dataStreamID protocol.St
StreamID: uint32(dataStreamID),
EndHeaders: true,
BlockFragment: w.hbuf.Bytes(),
Priority: http2.PriorityParam{Weight: 0xff},
})
}

View File

@@ -47,6 +47,7 @@ var _ = Describe("Request", func() {
rw.WriteRequest(req, 1337)
headerFrame, headerFields := decode(headerStream.Bytes())
Expect(headerFrame.StreamID).To(Equal(uint32(1337)))
Expect(headerFrame.HasPriority()).To(BeTrue())
Expect(headerFields).To(HaveKeyWithValue(":authority", "quic.clemente.io"))
Expect(headerFields).To(HaveKeyWithValue(":method", "GET"))
Expect(headerFields).To(HaveKeyWithValue(":path", "/index.html?foo=bar"))