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

Return an Error on Incorrect Content-Type for Search Requests #524

Closed
marc-ajs opened this issue Nov 10, 2021 · 0 comments
Closed

Return an Error on Incorrect Content-Type for Search Requests #524

marc-ajs opened this issue Nov 10, 2021 · 0 comments
Assignees
Labels
bug Something isn't working module:rest-api
Milestone

Comments

@marc-ajs
Copy link

marc-ajs commented Nov 10, 2021

Posting a query as payload with a incorrect content-type header, the result is a 200 OK.
Instead of a 415 Unsupported Media Type message, all resources of the searched type are displayed.

The used (faulty) curl request looked like this:

curl --location --request POST 'http://localhost:8080/fhir/Condition/_search' \
  --header 'Accept-Encoding: CSQ' \
  --header 'Content-Type: codex/json' \
  --header 'Prefer: handling=strict' \
  --data-raw '{
    "code": "119206002"
  }'

Blaze works fine when using the correct headers and payload format:

curl --location --request POST 'http://localhost:8080/fhir/Condition/_search' \
  --header 'Accept-Encoding: CSQ' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Prefer: handling=strict' \
  --data-raw 'code=119206002'
@alexanderkiel alexanderkiel changed the title Display "415 Unsupportet Media Type" for incorrect Content-Type Return an Error on Incorrect Content-Type for Search Requests Nov 10, 2021
@alexanderkiel alexanderkiel self-assigned this Nov 10, 2021
@alexanderkiel alexanderkiel added the bug Something isn't working label Nov 10, 2021
@alexanderkiel alexanderkiel added this to the v0.13.2 milestone Nov 10, 2021
@alexanderkiel alexanderkiel removed this from the v0.13.2 milestone Nov 22, 2021
@alexanderkiel alexanderkiel added this to the v0.17.4 milestone May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:rest-api
Projects
None yet
Development

No branches or pull requests

2 participants