Skip to content

Test automatic request compression for JSON and raw bodies - #1972

Open
augrclk wants to merge 1 commit into
httpie:masterfrom
augrclk:test/automatic-request-compression
Open

augrclk wants to merge 1 commit into
httpie:masterfrom
augrclk:test/automatic-request-compression

Conversation

@augrclk

@augrclk augrclk commented Oct 12, 2026

Copy link
Copy Markdown

The compression suite covers forcing deflate with two --compress flags and skipping a small body with one flag. It does not currently exercise the normal case where one flag compresses a body because the result is smaller.

This adds end-to-end JSON and raw-body cases over both HTTP and HTTPS. They check that the server receives Content-Encoding: deflate, that decompression restores the original payload, and that Content-Length equals the compressed byte count. No production code or CLI behavior changes.

Validation on Python 3.12.14 / macOS 26.6.1:

  • python -m pytest tests/test_compress.py -q: 20 passed, including the four new cases.
  • Full suite: 1020 passed, 3 failed, 5 skipped, 4 xfailed. The failures are the existing test_naked_invocation error-text expectation and the two Big5 charset-detection cases. All three failures were reproduced from an unchanged archive of baseline 5b604c3 in the same environment.
  • Full configured flake8 check: passed.
  • git diff --check: passed.

Prepared and tested with assistance from OpenAI Codex. I added my name to AUTHORS.md as suggested by CONTRIBUTING.md.

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