Skip to content

Malformed response to request with offset larger than resultset in combination with Prefer:count=exact #4455

@ChristianBisig1

Description

@ChristianBisig1

Environment

  • PostgreSQL version: PostgreSQL 15.13
  • PostgREST version: postgrest/postgrest:v13.0.8

Description of issue

An invalid response is returned to a request that has an offset query parameter specified that is larger than the number of entries in the underlying table. (only if the Prefer:count=exact header is set on the request)

curl -i "http://localhost:3000/items?offset=2000" -H "Prefer: count=exact"

Until postgrest version v12.2.12 the following response was returned
HTTP/1.1 416 Requested Range Not Satisfiable

Later postgrest versions return a malformed response that cannot be parsed

Metadata

Metadata

Assignees

Labels

messagesuser-facing error/informative messages

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions