From 41f01b163332de0eea0c686a31b71349bb598355 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Fri, 17 Aug 2012 16:46:50 +0900 Subject: [PATCH] bug fix of hasBody. --- warp/Network/Wai/Handler/Warp/Response.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/warp/Network/Wai/Handler/Warp/Response.hs b/warp/Network/Wai/Handler/Warp/Response.hs index 3c150f7db..031b799e5 100644 --- a/warp/Network/Wai/Handler/Warp/Response.hs +++ b/warp/Network/Wai/Handler/Warp/Response.hs @@ -173,10 +173,13 @@ checkLength = lookup H.hContentLength ---------------------------------------------------------------- hasBody :: H.Status -> Request -> Bool -hasBody s req = s /= H.Status 204 "" - && s /= H.status304 - && H.statusCode s >= 200 - && requestMethod req /= H.methodHead +hasBody s req = sc /= 204 + && sc /= 304 + && sc >= 200 + && method /= H.methodHead + where + sc = H.statusCode s + method = requestMethod req ----------------------------------------------------------------