Skip to content

Conversation

@mattwang44
Copy link
Member

@mattwang44 mattwang44 commented Sep 22, 2025

Reason

CS-5166

The POST requests with content type header not exactly to be but contains application/json (e.g. Content-Type: application/json; charset=UTF-8) is always failed to pass the validation, as it's not serialized as a dictionary.

Changes

load body as json whenever content type header has application/json

Test Scope

Checks

  • Unit tests are included or not applicable.

@mattwang44 mattwang44 force-pushed the fix-should-load-body-as-json-whenever-header-contains-application-json branch from 4f0ce45 to 40e0205 Compare September 22, 2025 07:43
@mattwang44 mattwang44 requested a review from CJHwong September 22, 2025 08:45
- Add null check for request.content_type in decorator to prevent errors
- Fix test utility to set content type in initial request creation instead of META
- Ensures proper content_type property behavior for both WSGI and ASGI requests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mattwang44 mattwang44 force-pushed the fix-should-load-body-as-json-whenever-header-contains-application-json branch from cf66eea to f279e10 Compare September 22, 2025 09:24
@mattwang44 mattwang44 merged commit 67eb7ac into develop Sep 22, 2025
2 checks passed
@mattwang44 mattwang44 deleted the fix-should-load-body-as-json-whenever-header-contains-application-json branch September 22, 2025 09:26
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.

3 participants