Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept header value shoud be case-insensitive #3478

Closed
antoinebesnardof opened this issue May 3, 2024 · 0 comments · Fixed by #3489
Closed

Accept header value shoud be case-insensitive #3478

antoinebesnardof opened this issue May 3, 2024 · 0 comments · Fixed by #3489
Assignees
Labels
bug difficulty: beginner Pure Haskell task http http compliance

Comments

@antoinebesnardof
Copy link

Environment

  • PostgreSQL version: 10.0.7
  • PostgREST version: docker image postgrest/postgrest:v12.0.2
  • Operating system: Linux

Description of issue

When specifying an Accept header with value Application/json (with an uppsercase letter at beginning) , PostgREST returns a 415 - Unsupported Media Type with content:

{
    "code": "PGRST107",
    "details": null,
    "hint": null,
    "message": "None of these media types are available: Application/json"
}

As stated in RFC 7231, Media Types are case-insensitive.

PostgREST may then use the application/json Media Type Handler.

Thank you for all this work.

@steve-chavez steve-chavez added http http compliance difficulty: beginner Pure Haskell task labels May 6, 2024
@develop7 develop7 self-assigned this May 7, 2024
develop7 added a commit to develop7/postgrest that referenced this issue May 7, 2024
The Accept header is parsed case-insensitively now, introducing proper
handling of media types specified in upper- and/or mixed-case.

Fixes PostgREST#3478
wolfgangwalther pushed a commit to develop7/postgrest that referenced this issue May 9, 2024
The Accept header is parsed case-insensitively now, introducing proper
handling of media types specified in upper- and/or mixed-case.

Fixes PostgREST#3478
wolfgangwalther pushed a commit that referenced this issue May 9, 2024
The Accept header is parsed case-insensitively now, introducing proper
handling of media types specified in upper- and/or mixed-case.

Fixes #3478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug difficulty: beginner Pure Haskell task http http compliance
Development

Successfully merging a pull request may close this issue.

4 participants