JSON formatting ignores uppercase and mixed-case Content-Type values
JSON response formatting depends on the casing of the Content-Type value. A response with APPLICATION/JSON or Application/Problem+JSON; charset=utf-8 is left compact by http --pretty=format --body URL, while the equivalent lowercase type is formatted.
For a response body {"message":"ok"}, expected output is:
{
"message": "ok"
}Actual output retains {"message":"ok"} on one line. Media type names are case-insensitive. The JSON formatter's substring checks currently use the original case.
Reproduced through HTTPie's CLI entry with responses serving these exact content types, against master 5b604c37c6c67e18e7c3e9aee6c88a8c22b98345, Python 3.12.13 / macOS. Both new regressions fail on the original formatter.
Investigated with OpenAI Codex assistance.
Source: httpie/cli