Skip to content

Commit

Permalink
adding the host header from :authority. (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Dec 7, 2015
1 parent 2936c25 commit 776a8dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions warp/Network/Wai/Handler/Warp/HTTP2/Request.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 776a8dc

Please sign in to comment.