Skip to content

Conversation

@DCchoudhury15
Copy link

Change(s)

Change Type: Fixed

Change Category: Interface

Changelog Entry: Fixed an issue where POST and PUT requests missing the Content-Type: application/json header would silently succeed (returning 200 OK) with an empty body instead of failing. These requests now correctly return 415 Unsupported Media Type.

How to Test

The fix can be verified by sending a request to any resource endpoint (e.g., /datasets) with a body but without the Content-Type header.

Verification Steps:

  1. Spin up the application stack: docker compose up --build
  2. Run a python script (using TestClient with dependency overrides to bypass authentication) that sends a PUT or POST request with a valid body string but no content-type header.
  3. Assert that the response status code is 415 (previously it was 200 with no action taken).

I verified this locally using a standalone script inside the Docker container that mocked the user authentication dependency to isolate the header check logic.

Checklist

  • [] Tests have been added or updated to reflect the changes, or their absence is explicitly explained.
  • [] Documentation has been added or updated to reflect the changes, or their absence is explicitly explained. (Error handling fix; no documentation changes required).
  • A self-review has been conducted checking:
    • No unintended changes have been committed.
    • The changes in isolation seem reasonable.
    • Anything that may be odd or unintuitive is provided with a GitHub comment explaining it.
  • All CI checks pass before pinging a reviewer, or provide an explanation if they do not.
  • The PR title matches the changelog entry's one-line description.

Related Issues

Closes #622

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.

Missing the content-type header fails silently

1 participant