1xx and 304 MUST not have its body according to RFC 2616.
commit26308f27e44b508c07c82e8e00adfd4dbf865f72
authorKazu Yamamoto <kazu@iij.ad.jp>
dateThu 18 Aug 2011, 10:44 (15 years ago)
parentc0cea0d
warp/Network/Wai/Handler/Warp.hs+2−1
@@ -334,7 +334,8 @@ isChunked :: H.HttpVersion -> Bool
334334isChunked = (==) H.http11
335335
336336hasBody :: H.Status -> Request -> Bool
337−hasBody s req = s /= (H.Status 204 "") && requestMethod req /= "HEAD"
337+hasBody s req = s /= (H.Status 204 "") && s /= H.status304 &&
338+ H.statusCode s >= 200 && requestMethod req /= "HEAD"
338339
339340sendResponse :: T.Handle
340341 -> Request -> Socket -> Response -> IO Bool