Skip to content

Format JSON responses with an uppercase Content-Type - #2009

Open
r00tkrnl wants to merge 1 commit into
httpie:masterfrom
r00tkrnl:json-format-case-insensitive
Open

r00tkrnl wants to merge 1 commit into
httpie:masterfrom
r00tkrnl:json-format-case-insensitive

Conversation

@r00tkrnl

Copy link
Copy Markdown

a response with APPLICATION/JSON or Application/Problem+JSON; charset=utf-8 stayed on one line while the lowercase type got formatted

media type names are case insensitive so the formatter now lowercases the mime before its substring checks

test in tests/test_json.py covers lowercase uppercase and a mixed case problem+json w a charset

closes #1958

Media type names are case insensitive so `APPLICATION/JSON` has to be
formatted like `application/json`.

Refs httpie#1958

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.

JSON formatting ignores uppercase and mixed-case Content-Type values

1 participant