fix: range request with first position same as length return status 206
This commit is contained in:
committed by
Steve Chavez
parent
6c8ce3929c
commit
d7dfdaa03f
@@ -453,3 +453,17 @@ spec = do
|
||||
{ matchStatus = 416
|
||||
, matchHeaders = ["Content-Range" <:> "*/15"]
|
||||
}
|
||||
|
||||
it "refuses a range with first position the same as number of items" $
|
||||
request methodGet "/rpc/getitemrange?min=1&max=2"
|
||||
(rangeHdrsWithCount $ ByteRangeFromTo 1 2) mempty
|
||||
`shouldRespondWith`
|
||||
[json| {
|
||||
"message":"Requested range not satisfiable",
|
||||
"code":"PGRST103",
|
||||
"details":"An offset of 1 was requested, but there are only 1 rows.",
|
||||
"hint":null
|
||||
}|]
|
||||
{ matchStatus = 416
|
||||
, matchHeaders = ["Content-Range" <:> "*/1"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user