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 [ responseLBS status206 [
json, json,
("Content-Range", ("Content-Range",
(BS.pack . show . rrFrom ) rr <> "-" if rrTotal rr == 0
<> (BS.pack . show . rrTo ) rr <> "/" then "*/0"
<> (BS.pack . show . rrTotal) rr else (BS.pack . show . rrFrom ) rr <> "-"
<> (BS.pack . show . rrTo ) rr <> "/"
<> (BS.pack . show . rrTotal) rr
) )
] (rrBody rr) ] (rrBody rr)