]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
test/pytest_suite: fix more tests broken by httpx auto-decompression
authorJim Jagielski <jim@apache.org>
Wed, 3 Jun 2026 21:25:44 +0000 (21:25 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 3 Jun 2026 21:25:44 +0000 (21:25 +0000)
commit5079dfa77f9e5ae1a029bb78199ed250d38ab42e
tree2d7623bf6d0114af108b4874a3fb25f228222312
parentcde30172651b7f7f5f2203e4649a72c53de6b076
test/pytest_suite: fix more tests broken by httpx auto-decompression

httpx transparently inflates gzip/deflate response bodies (it keeps the
Content-Encoding header but .content/.text are the decoded plaintext). Three
more tests asserted on the body of a compressed response and so were wrong:

  - pr43939 / pr17629: re-POSTed r.content (decoded plaintext, not the gzip
    stream) through the inflate input filter -- same round-trip bug as
    pr49328/deflate.
  - reflector: 'assert r.text != payload' could never hold, since httpx
    decoded the gzip body straight back to the payload.

Generalise the GET_RAW helper into a raw_response(method, path, ...) that
streams the response, reads iter_raw() (undecoded bytes), and stashes them on
.raw_content while leaving .status_code/.headers intact -- so tests can assert
on both the raw body and the headers. GET_RAW now delegates to it; update the
three tests to use raw_response/.raw_content.

The length-based tests (rwrite, passbrigade, getfile, byterange7) are
unaffected: they measure len(.content) after decoding, which equals the
original length regardless of transfer compression.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934950 13f79535-47bb-0310-9956-ffa450edef68
test/pytest_suite/apache_pytest/client.py
test/pytest_suite/tests/t/apache/test_pr17629.py
test/pytest_suite/tests/t/apache/test_pr43939.py
test/pytest_suite/tests/t/modules/test_reflector.py