FAILURE MAP
← Case archive

FA-6951 / Content negotiation / Open access

Unsupported coding is rejected before body decoding · case 01

Unsupported coding is rejected before body decoding.

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

ROOT CAUSE

The faulty implementation uses `any(c in supported for c in codings)` for the unsupported-coding-is-rejected-before-body-decoding decision.

VERIFIED REPAIR

Apply the explicit unsupported-coding-is-rejected-before-body-decoding contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `bool(codings) and all(c in supported for c in codings)` and still violates a separate fixture.

Case contract

Bounded offline decision model: unsupported coding is rejected before body decoding. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

Why this case matters

This deterministic content negotiation model isolates the unsupported-coding-is-rejected-before-body-decoding 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(codings, supported):
    return any(c in supported for c in codings)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['gzip', 'z'], ['gzip']), False)", "check('fixture 2', solve([], ['gzip']), True)", "check('fixture 3', solve(['gzip'], ['gzip']), True)", "check('fixture 4', solve(['z'], []), False)"]
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 2FalseTrueFailed
fixture 3TrueTruePassed
fixture 4FalseFalsePassed
fixture 1TrueFalseFailed

SHA-256 / ee20d137fb2b75bf21ccb5fa664d18175db246a145cefad445aca79306bfc636

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(codings, supported):
    return bool(codings) and all(c in supported for c in codings)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['gzip', 'z'], ['gzip']), False)", "check('fixture 2', solve([], ['gzip']), True)", "check('fixture 3', solve(['gzip'], ['gzip']), True)", "check('fixture 4', solve(['z'], []), False)"]
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 2FalseTrueFailed
fixture 3TrueTruePassed
fixture 4FalseFalsePassed
fixture 1FalseFalsePassed

SHA-256 / d63c5e5a9710f52109a952fc78f67e4bbbda8668ea547671400a5dd9a4d31672

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(codings, supported):
    return all(c in supported for c in codings)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['gzip', 'z'], ['gzip']), False)", "check('fixture 2', solve([], ['gzip']), True)", "check('fixture 3', solve(['gzip'], ['gzip']), True)", "check('fixture 4', solve(['z'], []), False)"]
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 2TrueTruePassed
fixture 3TrueTruePassed
fixture 4FalseFalsePassed
fixture 1FalseFalsePassed

SHA-256 / d1f6a918841e9222cc83b72346d5b2f01c475ca1f34c687bb34df7b544ec3879

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.049079+00:00.

Case digest / 0897ed8035c002dacab95e3cbb82522489d742ecf392f84627e463ee32dc730b