Skip to content

fix: catch null byte error from pgstac#278

Merged
vincentsarago merged 2 commits into
mainfrom
fix/catch-null-byte-error
Jun 1, 2026
Merged

fix: catch null byte error from pgstac#278
vincentsarago merged 2 commits into
mainfrom
fix/catch-null-byte-error

Conversation

@vincentsarago

@vincentsarago vincentsarago commented May 12, 2026

Copy link
Copy Markdown
Member

another take at #256

@captaincoordinates here is another attempt at #256

Instead of cleaning the request using a middleware, I think it's better (IMO) to catch the error from Postgres and raise a generic error.

curl http://127.0.0.1:8080/collections/noaa-emergency-response%00/info
{
  "detail": "Backend returned an error for Collection `noaa-emergency-response\u0000`"
}


curl http://127.0.0.1:8080/collections/noaa-emergency-response/tiles/WebMercatorQuad/0/0/0/assets?sortby=id%00
{
  "detail": "Backend returned an error for mosaic with body {\"collections\":[\"noaa-emergency-response\"],\"sortby\":[{\"field\":\"id\\u0000\",\"direction\":\"asc\"}],\"filter-lang\":\"cql2-json\"}"
}

@captaincoordinates captaincoordinates left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this, thanks for making a change.

@vincentsarago vincentsarago merged commit f53d845 into main Jun 1, 2026
7 checks passed
@vincentsarago vincentsarago deleted the fix/catch-null-byte-error branch June 1, 2026 14:48
This was referenced Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants