FAILURE MAP
← Case archive

FA-7701 / WebSocket and browser transport policies / Open access

Cors non simple content type triggers preflight · case 01

Cors non simple content type triggers preflight.

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

ROOT CAUSE

The faulty implementation uses `method not in ("GET","HEAD","POST")` for the cors-non-simple-content-type-triggers-preflight decision.

VERIFIED REPAIR

Apply the explicit cors-non-simple-content-type-triggers-preflight contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `media != "text/plain"` and still violates a separate fixture.

Case contract

Bounded offline decision model: cors non simple content type triggers preflight. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

Why this case matters

This deterministic websocket and browser transport policies model isolates the cors-non-simple-content-type-triggers-preflight 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(method, media):
    return method not in ("GET","HEAD","POST")
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 'application/json'), True)", "check('fixture 2', solve('PUT', 'text/plain'), True)", "check('fixture 3', solve('POST', 'multipart/form-data'), False)", "check('fixture 4', solve('GET', 'text/plain'), 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 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1FalseTrueFailed

SHA-256 / 7fa02d58a1bd299cf2b37efebb1ecb802597ce83e8568e4825ec1d31f9caba7f

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(method, media):
    return media != "text/plain"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 'application/json'), True)", "check('fixture 2', solve('PUT', 'text/plain'), True)", "check('fixture 3', solve('POST', 'multipart/form-data'), False)", "check('fixture 4', solve('GET', 'text/plain'), 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 3TrueFalseFailed
fixture 4FalseFalsePassed
fixture 1TrueTruePassed

SHA-256 / effe922c111f63ddf7402b154800ac746e232c7c815dcec7d487ad5befc54827

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(method, media):
    return method not in ("GET","HEAD","POST") or media not in ("application/x-www-form-urlencoded","multipart/form-data","text/plain")
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 'application/json'), True)", "check('fixture 2', solve('PUT', 'text/plain'), True)", "check('fixture 3', solve('POST', 'multipart/form-data'), False)", "check('fixture 4', solve('GET', 'text/plain'), 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 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1TrueTruePassed

SHA-256 / 04542f6b4bc1de84916a057b2ead53ed3f1884a1b954a3497ed96e04bdcc92fd

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

Case digest / 1777fe8104c5b65730d8249672c329c49d7490ca4a5715fffd504441582064b6