From 776a8dc203e9d0e97e5090c8b29876b98b32bc47 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 7 Dec 2015 14:17:00 +0900 Subject: [PATCH] adding the host header from :authority. (#478) --- warp/Network/Wai/Handler/Warp/HTTP2/Request.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/warp/Network/Wai/Handler/Warp/HTTP2/Request.hs b/warp/Network/Wai/Handler/Warp/HTTP2/Request.hs index 57c78efb6..68b19ad41 100644 --- a/warp/Network/Wai/Handler/Warp/HTTP2/Request.hs +++ b/warp/Network/Wai/Handler/Warp/HTTP2/Request.hs @@ -55,7 +55,9 @@ mkRequest settings addr (ValidHeaders m p ma _ hdr) body = req , pathInfo = H.decodePathSegments path , rawQueryString = query , queryString = H.parseQuery query - , requestHeaders = hdr + , requestHeaders = case ma of + Nothing -> hdr + Just h -> (mk "host", h) : hdr , isSecure = True , remoteHost = addr , requestBody = body @@ -110,7 +112,7 @@ validateHeaders hs = case pseudo hs (emptyPseudo,id) of else Nothing | k == "content-length" - = normal kvs (p { contentLen = Just v },b) + = normal kvs (p { contentLen = Just v }, b . ((mk k,v) :)) | k == "host" = if isJust (colonAuth p) then normal kvs (p,b) else