Skip to content

fix(core): preserve query strings in HTTP wait URLs - #1148

Open
henricop wants to merge 1 commit into
testcontainers:mainfrom
henricop:fix/http-wait-url-query
Open

henricop wants to merge 1 commit into
testcontainers:mainfrom
henricop:fix/http-wait-url-query

Conversation

@henricop

@henricop henricop commented Nov 7, 2026

Copy link
Copy Markdown

HttpWaitStrategy.from_url("http://localhost:8080/health?ready=true") currently sends GET /health, dropping the query string. Health endpoints that require query parameters can therefore time out or validate the wrong request. The urlparse call also drops semicolon parameters from the final path segment.

Preserve the complete request target with urlsplit, and append the original query without decoding or re-encoding it. Fragments remain excluded from HTTP requests; port and TLS handling are unchanged.

Validation on main at 6146aa1170f415fcc825ed9bddc4eacbeb937a12:

  • All five new cases fail before the source change; 92 wait-strategy tests pass afterward.
  • Wait-strategy and utility suites: 105 passed.
  • Six probes using a real HTTP server on 127.0.0.1 confirm the actual request targets, including repeated/blank parameters, encoded characters, semicolon path parameters, root paths and fragments. The mapped-port target is a stub, not a Docker container.
  • All repository pre-commit formatting/Ruff/TOML/whitespace hooks pass. The full mypy hook reports five identical existing errors on the base and the patch (Docker stub _RestartPolicy export and four NetworkCollection.list calls); no new diagnostics. The changed source file typechecks.

The local Docker Desktop API did not respond to bounded probes, so Docker integration tests were not run. Python 3.13; mypy 2.3.0 and types-docker 7.2.0.20260728 were taken from uv.lock.

This branch has not been deployed

No deployments
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