Skip to content

Classify AWS JSON MIME types as text - #7418

Open
bsobel-cf wants to merge 2 commits into
mainfrom
bsobel/classify-aws-json-mime-types
Open

bsobel-cf wants to merge 2 commits into
mainfrom
bsobel/classify-aws-json-mime-types

Conversation

@bsobel-cf

@bsobel-cf bsobel-cf commented Sep 17, 2026

Copy link
Copy Markdown

Summary

  • Classify application/x-amz-json-1.0 and application/x-amz-json-1.1 as text.
  • Keep MimeType::isJson() unchanged and leave unknown AWS JSON versions non-text.
  • Add unit coverage for both supported versions and the 1.2 boundary.

AWS Bedrock returns the supported media types for JSON responses. Treating them as text prevents binary-body warnings when tooling inspects those responses without broadening JSON parsing behavior.

Testing

  • //src/workerd/util:mimetype-test@ with --runs_per_test=5
  • //src/workerd/util:mimetype-test@ with --config=clang-tidy
  • Edgeworker formatter and linter

AWS Bedrock responses use application/x-amz-json-1.0 and 1.1. Treat those exact subtypes as text so response inspection does not produce binary-body warnings. Keep isJson() unchanged and do not classify unknown versions as text.
@bsobel-cf
bsobel-cf requested review from a team as code owners September 17, 2026 17:24
@ask-bonk

ask-bonk Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

Iterate over the supported MIME test inputs by const reference to satisfy the range-copy lint.
@bsobel-cf bsobel-cf self-assigned this Sep 17, 2026
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.

1 participant