fix: regression by reverting fix that returned 206 when first-pos=length in Range header

This commit is contained in:
Laurence Isla
2023-10-21 16:28:08 -05:00
committed by GitHub
parent eb238ad678
commit 317619bf62
3 changed files with 30 additions and 32 deletions
+3 -3
View File
@@ -104,9 +104,9 @@ rangeStatusHeader topLevelRange queryTotal tableTotal =
rangeStatus :: Integer -> Integer -> Maybe Integer -> Status
rangeStatus _ _ Nothing = status200
rangeStatus lower upper (Just total)
| lower >= total && lower /= upper && lower /= 0 = status416 -- 416 Range Not Satisfiable
| (1 + upper - lower) < total = status206 -- 206 Partial Content
| otherwise = status200 -- 200 OK
| lower > total = status416 -- 416 Range Not Satisfiable
| (1 + upper - lower) < total = status206 -- 206 Partial Content
| otherwise = status200 -- 200 OK
contentRangeH :: (Integral a, Show a) => a -> a -> Maybe a -> Header
contentRangeH lower upper total =