Skip to content

Fix JSON media type detection for mixed-case Content-Type values - #1176

Merged
walkor merged 1 commit into
walkor:masterfrom
lanqing431:fix/json-media-type-case-20261127
Dec 6, 2026
Merged

walkor merged 1 commit into
walkor:masterfrom
lanqing431:fix/json-media-type-case-20261127

Conversation

@lanqing431

Copy link
Copy Markdown
Contributor

Recognize JSON Content-Type values case-insensitively, including vendor media types and charset parameters. Valid values such as Application/JSON currently select form decoding and lose the JSON fields. This restores the case-insensitive behavior before #1143 without changing multipart boundaries or the JSON/form cache separation.

Add five media-type datasets, each parsed twice to exercise cached results.

Validation on native PHP 8.3.16 / Pest 4.7.8 (Windows):

  • RequestPostTest: 4 failures before; 13 passing tests / 42 assertions after.
  • HTTP unit tests: 44 passing / 218 assertions.
  • All unit tests: 283 passing / 833 assertions.
  • Full suite: 9 failures before, 5 after. The same five HTTP/WebSocket server-start feature failures remain on unmodified upstream source in this environment; one existing test is skipped.
  • PHPStan: identical three existing diagnostics in Ws.php and Worker.php before and after. Both modified PHP files pass syntax checks.

@walkor
walkor merged commit 3347d2d into walkor:master Dec 6, 2026
30 checks passed
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.

2 participants