FAILURE MAP
← Case archive

FA-26586 / HTTP ranges / Open access

Errors after partial headers abort instead of injecting a second response · case 01

Errors after partial headers abort instead of injecting a second response.

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

ROOT CAUSE

The stream-error-after-headers decision uses return ["error500",""] if failure else ["continue",body].

VERIFIED REPAIR

Apply the bounded decision exactly: return (["abort",""] if headers_sent else ["error500",""]) if failure else ["continue",body]

Unsuccessful approach: The partial repair uses return ["abort",""] if headers_sent else (["error500",""] if failure else ["continue",body]), which still violates the stated contract.

Case contract

If failure occurs after headers, abort with empty body; before headers return error500. No failure continues body.

Why this case matters

Range responses combine representation identity, conditional requests, framing, and partial-object state.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(headers_sent, failure, body):
    return ["error500",""] if failure else ["continue",body]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-error-after-headers fixture 0', solve(True,True,"p"*N), ["abort",""])
check('stream-error-after-headers fixture 1', solve(True,False,"p"*N), ["continue","p"*N])
check('stream-error-after-headers fixture 2', solve(False,True,"p"), ["error500",""])
check('stream-error-after-headers fixture 3', solve(False,False,"p"), ["continue","p"])
check('stream-error-after-headers fixture 4', solve(True,True,""), ["abort",""])
check('stream-error-after-headers fixture 5', solve(True,False,""), ["continue",""])
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
stream-error-after-headers fixture 0['error500', '']['abort', '']Failed
stream-error-after-headers fixture 1['continue', 'p']['continue', 'p']Passed
stream-error-after-headers fixture 2['error500', '']['error500', '']Passed
stream-error-after-headers fixture 3['continue', 'p']['continue', 'p']Passed
stream-error-after-headers fixture 4['error500', '']['abort', '']Failed
stream-error-after-headers fixture 5['continue', '']['continue', '']Passed

SHA-256 / ad135279c2198d78df095dab23f7051d7def53f919b871a1da58a3347aeb97c1

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(headers_sent, failure, body):
    return ["abort",""] if headers_sent else (["error500",""] if failure else ["continue",body])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-error-after-headers fixture 0', solve(True,True,"p"*N), ["abort",""])
check('stream-error-after-headers fixture 1', solve(True,False,"p"*N), ["continue","p"*N])
check('stream-error-after-headers fixture 2', solve(False,True,"p"), ["error500",""])
check('stream-error-after-headers fixture 3', solve(False,False,"p"), ["continue","p"])
check('stream-error-after-headers fixture 4', solve(True,True,""), ["abort",""])
check('stream-error-after-headers fixture 5', solve(True,False,""), ["continue",""])
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
stream-error-after-headers fixture 0['abort', '']['abort', '']Passed
stream-error-after-headers fixture 1['abort', '']['continue', 'p']Failed
stream-error-after-headers fixture 2['error500', '']['error500', '']Passed
stream-error-after-headers fixture 3['continue', 'p']['continue', 'p']Passed
stream-error-after-headers fixture 4['abort', '']['abort', '']Passed
stream-error-after-headers fixture 5['abort', '']['continue', '']Failed

SHA-256 / 3b9659ec65fee67ea7a77cace2a2aff3a09c7700ebfce37d7ace19ac56ca3416

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(headers_sent, failure, body):
    return (["abort",""] if headers_sent else ["error500",""]) if failure else ["continue",body]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-error-after-headers fixture 0', solve(True,True,"p"*N), ["abort",""])
check('stream-error-after-headers fixture 1', solve(True,False,"p"*N), ["continue","p"*N])
check('stream-error-after-headers fixture 2', solve(False,True,"p"), ["error500",""])
check('stream-error-after-headers fixture 3', solve(False,False,"p"), ["continue","p"])
check('stream-error-after-headers fixture 4', solve(True,True,""), ["abort",""])
check('stream-error-after-headers fixture 5', solve(True,False,""), ["continue",""])
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
stream-error-after-headers fixture 0['abort', '']['abort', '']Passed
stream-error-after-headers fixture 1['continue', 'p']['continue', 'p']Passed
stream-error-after-headers fixture 2['error500', '']['error500', '']Passed
stream-error-after-headers fixture 3['continue', 'p']['continue', 'p']Passed
stream-error-after-headers fixture 4['abort', '']['abort', '']Passed
stream-error-after-headers fixture 5['continue', '']['continue', '']Passed

SHA-256 / 79aa7d1fa772b73488fed46ed2b89a574827d4f6a07414fe8d11f45419415e6c

Verification & scope

Deterministic simplified range service, with stipulated local policies and already parsed trusted inputs; not a complete HTTP implementation. 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:41:17.350781+00:00.

Case digest / 88a691b668da279421990ec47786d8ff8ca997db73f8bd2d5b13db97e7fb3e8b