on master help sign in
adding the host header from :authority. (#478)
commit776a8dc203e9d0e97e5090c8b29876b98b32bc47 authorKazu Yamamoto <kazu@iij.ad.jp> dateMon 7 Dec 2015, 14:17 (11 years ago) parent2936c25
1 file changed+4−2
warp/Network/Wai/Handler/Warp/HTTP2/Request.hs+4−2
warp/Network/Wai/Handler/Warp/HTTP2/Request.hs+4−2
@@ -55,7 +55,9 @@ mkRequest settings addr (ValidHeaders m p ma _ hdr) body = req
5555 , pathInfo = H.decodePathSegments path
5656 , rawQueryString = query
5757 , queryString = H.parseQuery query
58− , requestHeaders = hdr
58+ , requestHeaders = case ma of
59+ Nothing -> hdr
60+ Just h -> (mk "host", h) : hdr
5961 , isSecure = True
6062 , remoteHost = addr
6163 , requestBody = body
@@ -110,7 +112,7 @@ validateHeaders hs = case pseudo hs (emptyPseudo,id) of
110112 else
111113 Nothing
112114 | k == "content-length"
113− = normal kvs (p { contentLen = Just v },b)
115+ = normal kvs (p { contentLen = Just v }, b . ((mk k,v) :))
114116 | k == "host" = if isJust (colonAuth p) then
115117 normal kvs (p,b)
116118 else