Proper range header for empty result

Fixes #22
This commit is contained in:
Joe Nelson
2014-08-06 12:30:03 -07:00
parent cb2e421333
commit e58fad9002
+5 -3
View File
@@ -91,9 +91,11 @@ respondWithRangedResult rr =
responseLBS status206 [
json,
("Content-Range",
(BS.pack . show . rrFrom ) rr <> "-"
<> (BS.pack . show . rrTo ) rr <> "/"
<> (BS.pack . show . rrTotal) rr
if rrTotal rr == 0
then "*/0"
else (BS.pack . show . rrFrom ) rr <> "-"
<> (BS.pack . show . rrTo ) rr <> "/"
<> (BS.pack . show . rrTotal) rr
)
] (rrBody rr)