FAILURE MAP
← Case archive

FA-7046 / Proxy forwarding / Open access

Upstream port default depends on scheme · case 01

Upstream port default depends on scheme.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The faulty implementation uses `port or 80` for the upstream-port-default-depends-on-scheme decision.

VERIFIED REPAIR

Apply the explicit upstream-port-default-depends-on-scheme contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `443 if scheme == "https" else 80` and still violates a separate fixture.

Case contract

Bounded offline decision model: upstream port default depends on scheme. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

Why this case matters

This deterministic proxy forwarding model isolates the upstream-port-default-depends-on-scheme policy at a network component boundary.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(scheme, port):
    return port or 80
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https', None), 443)", "check('fixture 2', solve('http', 8080), 8080)", "check('fixture 3', solve('http', None), 80)", "check('fixture 4', solve('https', 8443), 8443)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 280808080Passed
fixture 38080Passed
fixture 484438443Passed
fixture 180443Failed

SHA-256 / a064729712e76eadbafc06f8ac7378c059150c7cb6216a142878dea90eec7f8c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(scheme, port):
    return 443 if scheme == "https" else 80
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https', None), 443)", "check('fixture 2', solve('http', 8080), 8080)", "check('fixture 3', solve('http', None), 80)", "check('fixture 4', solve('https', 8443), 8443)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 2808080Failed
fixture 38080Passed
fixture 44438443Failed
fixture 1443443Passed

SHA-256 / 62988179e803a0c56ab6df8e387574803e6c8295f100f8cd2ce9eb636773db5f

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(scheme, port):
    return port if port is not None else (443 if scheme == "https" else 80)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https', None), 443)", "check('fixture 2', solve('http', 8080), 8080)", "check('fixture 3', solve('http', None), 80)", "check('fixture 4', solve('https', 8443), 8443)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 280808080Passed
fixture 38080Passed
fixture 484438443Passed
fixture 1443443Passed

SHA-256 / dba9a2305433ad55b4f4e11990960e9b8f3b30141d88f6e8097f49af280a7b80

Verification & scope

Bounded deterministic policy model over validated inputs; not a complete protocol stack or an interoperability claim. The five variants rotate the same explicit fixture set. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:07.843980+00:00.

Case digest / 682552dbb0c55dddb8bc3ecd7c4b8112a9fa7d5528328943bfdb4bc2032b30a8