on master help sign in
adding comments for HEAD.
commit597cd4afed7f9e9324c270b3a8fecb82371626aa authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 1 Dec 2015, 16:44 (11 years ago) parenta364c54
1 file changed+4−3
warp/Network/Wai/Handler/Warp/Response.hs+4−3
warp/Network/Wai/Handler/Warp/Response.hs+4−3
@@ -161,9 +161,10 @@ sendResponse :: ByteString -- ^ default server value
161161sendResponse defServer conn ii req reqidxhdr src response = do
162162 hs <- addServerAndDate hs0
163163 if hasBody s then do
164− -- HEAD comes here even if it does not have body. We include HEAD
165− -- responses here so that we generate appropriate content-length
166− -- headers below.
164+ -- The response to HEAD does not have body.
165+ -- But to handle the conditional requests defined RFC 7232 and
166+ -- to generate appropriate content-length, content-range,
167+ -- and status, the response to HEAD is processed here.
167168 --
168169 -- See definition of rsp below for proper body stripping.
169170 sendRsp conn ii ver s hs rsp