JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

ensure_correct_media_type does not set response Content-Type to application/vnd.api+json

Open
#698 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
Dominant language
Ruby
Stars
2.3k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

I noticed that when the ensure_correct_media_type before_action is run, and validation fails (Content-Type is not application/vnd.api+json, that the response from the server has a Content-Type header set to application/json. According to the spec, shouldn't this failed validation also return a Content-Type header of application/vnd.api+json?

Thanks ahead of time for the help.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the ensure_correct_media_type before_action and trace the response built when validation fails because Content-Type is not application/vnd.api+json. Check the existing response handling and tests, if present. Done means that failed validation returns a response with the application/vnd.api+json Content-Type required by the JSON:API specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.