Skip to content

fix(postgrest): handle empty HEAD error responses - #1587

Open
SohailKhan0525 wants to merge 1 commit into
supabase:mainfrom
SohailKhan0525:fix/head-query-error
Open

fix(postgrest): handle empty HEAD error responses#1587
SohailKhan0525 wants to merge 1 commit into
supabase:mainfrom
SohailKhan0525:fix/head-query-error

Conversation

@SohailKhan0525

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix.

What is the current behavior?

A HEAD request that returns an HTTP error with an empty response body causes the client to attempt JSON parsing of the empty body, resulting in a Pydantic ValidationError instead of the expected APIError.

What is the new behavior?

Empty error response bodies are handled before JSON parsing, and the existing default APIError is raised with the HTTP status code.

A regression test verifies that model_validate_json is not called for an empty HEAD error response.

Additional context

This addresses supabase/supabase#1584.

Tests:

  • Async integration tests: 53 passed
  • Sync integration tests: 52 passed

@SohailKhan0525
SohailKhan0525 requested review from a team and o-santi as code owners August 24, 2026 06:34
Copilot AI lite review requested due to automatic review settings August 24, 2026 06:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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