on master help sign in
removing unnecessary code.
8bd64ceKazu Yamamoto
warp/Network/Wai/Handler/Warp/Response.hs+5−6
@@ -179,7 +179,7 @@ sendResponse :: ByteString -- ^ default server value
179 -> IO Bool -- ^ Returing True if the connection is persistent.
179 -> IO Bool -- ^ Returing True if the connection is persistent.
180sendResponse defServer conn ii req reqidxhdr src response = do
180sendResponse defServer conn ii req reqidxhdr src response = do
181 hs <- addServerAndDate hs0
181 hs <- addServerAndDate hs0
182− if hasBody s req then do
182+ if hasBody s then do
183 -- HEAD comes here even if it does not have body.
183 -- HEAD comes here even if it does not have body.
184 sendRsp conn ver s hs rsp
184 sendRsp conn ver s hs rsp
185 T.tickle th
185 T.tickle th
@@ -362,13 +362,12 @@ infoFromResponse rspidxhdr (isPersist,isChunked) = (isKeepAlive, needsChunked)
362
362
363----------------------------------------------------------------
363----------------------------------------------------------------
364
364
365−hasBody :: H.Status -> Request -> Bool
365+hasBody :: H.Status -> Bool
366−hasBody s req = sc /= 204
366+hasBody s = sc /= 204
367− && sc /= 304
367+ && sc /= 304
368− && sc >= 200
368+ && sc >= 200
369 where
369 where
370 sc = H.statusCode s
370 sc = H.statusCode s
371− method = requestMethod req
372
371
373----------------------------------------------------------------
372----------------------------------------------------------------
374
373