@@ -148,14 +148,14 @@ sendResponse settings conn ii req reqidxhdr src response = do
148148 -- and status, the response to HEAD is processed here.
149149 --
150150 -- See definition of rsp below for proper body stripping.
151− (ms, mlen) <- sendRsp conn ii ver s hs rsp
151+ (ms, mlen) <- sendRsp conn ii req ver s hs rsp
152152 case ms of
153153 Nothing -> return ()
154154 Just realStatus -> logger req realStatus mlen
155155 T.tickle th
156156 return ret
157157 else do
158− _ <- sendRsp conn ii ver s hs RspNoBody
158+ _ <- sendRsp conn ii req ver s hs RspNoBody
159159 logger req s Nothing
160160 T.tickle th
161161 return isPersist
@@ -225,6 +225,7 @@ data Rsp = RspNoBody
225225
226226sendRsp :: Connection
227227 -> InternalInfo
228+ -> Request
228229 -> H.HttpVersion
229230 -> H.Status
230231 -> H.ResponseHeaders
@@ -233,7 +234,7 @@ sendRsp :: Connection
233234
234235----------------------------------------------------------------
235236
236−sendRsp conn _ ver s hs RspNoBody = do
237+sendRsp conn _ _ ver s hs RspNoBody = do
237238 -- Not adding Content-Length.
238239 -- User agents treats it as Content-Length: 0.
239240 composeHeader ver s hs >>= connSendAll conn
@@ -241,7 +242,7 @@ sendRsp conn _ ver s hs RspNoBody = do
241242
242243----------------------------------------------------------------
243244
244−sendRsp conn _ ver s hs (RspBuilder body needsChunked) = do
245+sendRsp conn _ _ ver s hs (RspBuilder body needsChunked) = do
245246 header <- composeHeaderBuilder ver s hs needsChunked
246247 let hdrBdy
247248 | needsChunked = header <> chunkedTransferEncoding body
@@ -254,7 +255,7 @@ sendRsp conn _ ver s hs (RspBuilder body needsChunked) = do
254255
255256----------------------------------------------------------------
256257
257−sendRsp conn _ ver s hs (RspStream streamingBody needsChunked th) = do
258+sendRsp conn _ _ ver s hs (RspStream streamingBody needsChunked th) = do
258259 header <- composeHeaderBuilder ver s hs needsChunked
259260 (recv, finish) <- newBlazeRecv $ reuseBufferStrategy
260261 $ toBuilderBuffer (connWriteBuffer conn) (connBufferSize conn)
@@ -278,7 +279,7 @@ sendRsp conn _ ver s hs (RspStream streamingBody needsChunked th) = do
278279
279280----------------------------------------------------------------
280281
281−sendRsp conn _ _ _ _ (RspRaw withApp src tickle) = do
282+sendRsp conn _ _ _ _ _ (RspRaw withApp src tickle) = do
282283 withApp recv send
283284 return (Nothing, Nothing)
284285 where
@@ -292,10 +293,10 @@ sendRsp conn _ _ _ _ (RspRaw withApp src tickle) = do
292293
293294-- Sophisticated WAI applications.
294295-- We respect s0. s0 MUST be a proper value.
295−sendRsp conn ii ver s0 hs0 (RspFile path (Just part) _ isHead hook) =
296− sendRspFile2XX conn ii ver s0 hs h path beg len isHead hook
296+sendRsp conn ii req ver s0 hs0 (RspFile path (Just part) _ isHead hook) =
297+ sendRspFile2XX conn ii req ver s0 hs h path beg len isHead hook
297298 where
298− h = hash path
299+ h = hash $ rawPathInfo req
299300 beg = filePartOffset part
300301 len = filePartByteCount part
301302 hs = addContentHeadersForFilePart hs0 part
@@ -304,23 +305,24 @@ sendRsp conn ii ver s0 hs0 (RspFile path (Just part) _ isHead hook) =
304305
305306-- Simple WAI applications.
306307-- Status is ignored
307−sendRsp conn ii ver _ hs0 (RspFile path Nothing idxhdr isHead hook) = do
308− let h = hash path
308+sendRsp conn ii req ver _ hs0 (RspFile path Nothing idxhdr isHead hook) = do
309+ let h = hash $ rawPathInfo req
309310 efinfo <- E.try $ fileInfo' ii h path
310311 case efinfo of
311312 Left (_ex :: E.IOException) ->
312313#ifdef WARP_DEBUG
313314 print _ex >>
314315#endif
315− sendRspFile404 conn ii ver hs0
316+ sendRspFile404 conn ii req ver hs0
316317 Right finfo -> case conditionalRequest finfo hs0 idxhdr of
317− WithoutBody s -> sendRsp conn ii ver s hs0 RspNoBody
318− WithBody s hs beg len -> sendRspFile2XX conn ii ver s hs h path beg len isHead hook
318+ WithoutBody s -> sendRsp conn ii req ver s hs0 RspNoBody
319+ WithBody s hs beg len -> sendRspFile2XX conn ii req ver s hs h path beg len isHead hook
319320
320321----------------------------------------------------------------
321322
322323sendRspFile2XX :: Connection
323324 -> InternalInfo
325+ -> Request
324326 -> H.HttpVersion
325327 -> H.Status
326328 -> H.ResponseHeaders
@@ -331,8 +333,8 @@ sendRspFile2XX :: Connection
331333 -> Bool
332334 -> IO ()
333335 -> IO (Maybe H.Status, Maybe Integer)
334−sendRspFile2XX conn ii ver s hs h path beg len isHead hook
335− | isHead = sendRsp conn ii ver s hs RspNoBody
336+sendRspFile2XX conn ii req ver s hs h path beg len isHead hook
337+ | isHead = sendRsp conn ii req ver s hs RspNoBody
336338 | otherwise = do
337339 lheader <- composeHeader ver s hs
338340#ifdef WINDOWS
@@ -352,10 +354,11 @@ sendRspFile2XX conn ii ver s hs h path beg len isHead hook
352354
353355sendRspFile404 :: Connection
354356 -> InternalInfo
357+ -> Request
355358 -> H.HttpVersion
356359 -> H.ResponseHeaders
357360 -> IO (Maybe H.Status, Maybe Integer)
358−sendRspFile404 conn ii ver hs0 = sendRsp conn ii ver s hs (RspBuilder body True)
361+sendRspFile404 conn ii req ver hs0 = sendRsp conn ii req ver s hs (RspBuilder body True)
359362 where
360363 s = H.notFound404
361364 hs = replaceHeader H.hContentType "text/plain; charset=utf-8" hs0