Skip to content

Fix case-insensitive XML media type formatting - #1968

Open
nietus wants to merge 1 commit into
httpie:masterfrom
nietus:codex/fix-xml-media-type-case
Open

nietus wants to merge 1 commit into
httpie:masterfrom
nietus:codex/fix-xml-media-type-case

Conversation

@nietus

@nietus nietus commented Oct 6, 2026 •

Copy link
Copy Markdown

Summary

XML responses with uppercase or mixed-case media types currently bypass the XML formatter, for example APPLICATION/XML and Application/Atom+XML. Compare the media type case-insensitively so these responses receive the same formatting as their lowercase equivalents.

The patch changes only the formatter check and adds CLI-entry regression coverage, a documentation note and a changelog entry.

Validation

  • Both new regressions fail on unchanged upstream and pass with this patch.

  • python -m pytest tests/test_xml.py tests/test_output.py: 140 passed, 3 xfailed (27 warnings).

  • Changed-file Flake8 and git diff --check pass.

  • Tested on Windows with Python 3.12.

Prepared and tested with OpenAI Codex assistance.

Remote CI

Code style and Markdown checks have passed. The Ubuntu/Python 3.7 jobs fail in actions/setup-python before dependencies or tests run: Python 3.7 is unavailable for Ubuntu 24.04. Other matrix jobs were still running at this check; this is not a claim that the full CI passed.

CI failure investigation (2026-10-06)

Code style and Markdown checks passed. The XML regression tests also passed in CI. The failing checks include pre-existing Big5 charset detection, argparse help text, pyOpenSSL digest authentication, and Windows plugin tests. The master branch already reports the same failures in its 2026-08-29 test run, before this contribution. Compare master Ubuntu 3.12, master pyOpenSSL, and master Windows plugin failures.

For an additional controlled local check, I ran the same 76 encoding, CLI UI, and XML tests with the original XML formatter and with this patch, using unchanged test files and dependencies (Windows, Python 3.12): original formatter: 71 passed, 5 failed; patched formatter: 73 passed, 3 failed. The two XML regressions are the only failures resolved by this patch; both Big5 failures and the help-text failure remain unchanged.

Ubuntu/Python 3.7 fails during setup because that interpreter is unavailable on Ubuntu 24.04. macOS jobs are still queued as of this check. Coverage fails because its test run reports the same two Big5 failures (1019 tests passed); it does not reach a successful coverage result. No unrelated CI or dependency changes have been added to this XML fix.

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