Skip to content

reverseproxy: Add regression test for DialInfo network override - #7758

Merged
francislavoie merged 1 commit into
caddyserver:masterfrom
eyupcanakman:feat/reverseproxy-dialinfo-network-test-6447
May 20, 2026
Merged

francislavoie merged 1 commit into
caddyserver:masterfrom
eyupcanakman:feat/reverseproxy-dialinfo-network-test-6447

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

Adds regression coverage for #6447, the tcp4/tcp6 upstream bug fixed by #7300.

A tcp4-prefixed upstream silently fell back to plain tcp, because dialContext only honored the resolved DialInfo network for unix sockets. #7300 widened that condition so DialInfo is honored whenever no upstream HTTP proxy is in use, and skipped for non-unix networks when a proxy is active. No test pinned either half.

What this tests

The test sets a DialInfo with network tcp4 in the request context, then checks where DialContext connects against a real tcp4 listener.

  • with no proxy in the context, it connects to the DialInfo address
  • with a proxy in the context, it connects to the default address instead

Reverting the #7300 condition makes both cases fail, so the test catches the original regression.

Assistance Disclosure

Claude wrote the test. I reviewed it, ran the reverseproxy suite, and verified it fails against the pre-#7300 behavior.

Covers caddyserver#6447, the tcp4/tcp6 upstream fallback fixed by caddyserver#7300.
dialContext honors the resolved DialInfo network when no upstream proxy is in use, and skips it for non-unix networks when a proxy is active.
The test pins both halves against a real tcp4 listener.
@CLAassistant

CLAassistant commented May 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@francislavoie francislavoie added the CI/CD 🔩 Automated tests, releases label May 20, 2026
@francislavoie francislavoie added this to the v2.11.4 milestone May 20, 2026
@francislavoie
francislavoie merged commit 0b265eb into caddyserver:master May 20, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD 🔩 Automated tests, releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants