on master help sign in
Fix .CGI
commitc4b2097eef27beff502d89903db67721d9ae3f4c authorMichael Snoyman <michael@snoyman.com> dateMon 2 Dec 2013, 09:04 (13 years ago) parent3977342
1 file changed+4−2
wai-extra/Network/Wai/Handler/CGI.hs+4−2
wai-extra/Network/Wai/Handler/CGI.hs+4−2
@@ -95,19 +95,21 @@ runGeneric vars inputH outputH xsendfile app = do
9595 a:_ -> addrAddress a
9696 [] -> error $ "Invalid REMOTE_ADDR or REMOTE_HOST: " ++ remoteHost'
9797 mask $ \restore -> do
98− let env = Request
98+ let reqHeaders = map (cleanupVarName *** B.pack) vars
99+ env = Request
99100 { requestMethod = rmethod
100101 , rawPathInfo = B.pack pinfo
101102 , pathInfo = H.decodePathSegments $ B.pack pinfo
102103 , rawQueryString = B.pack qstring
103104 , queryString = H.parseQuery $ B.pack qstring
104− , requestHeaders = map (cleanupVarName *** B.pack) vars
105+ , requestHeaders = reqHeaders
105106 , isSecure = isSecure'
106107 , remoteHost = addr
107108 , httpVersion = H.http11 -- FIXME
108109 , requestBody = inputH contentLength
109110 , vault = mempty
110111 , requestBodyLength = KnownLength $ fromIntegral contentLength
112+ , requestHeaderHost = lookup "host" reqHeaders
111113 }
112114 -- FIXME worry about exception?
113115 res <- restore $ app env