FA-27976 / HTTP redirects / Open access
Prepare upload metadata and handoff sequencing after a redirect decision: new request expect handshake · case 01
The new request starts an upload handshake after its method or body emptiness makes that handshake inapplicable.
ROOT CAUSE
The new-request-expect-handshake decision uses 'not drop and size != 0'; this violates the stipulated controller policy.
VERIFIED REPAIR
At this decision use "not drop and method not in ('GET','HEAD') and (size is None or size>0)", preserving the other controller outputs.
Unsuccessful approach: The partial repair uses "not drop and method not in ('GET','HEAD')" and still fails an explicit boundary or control.
Case contract
Prepare upload metadata and handoff sequencing after a redirect decision. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.
Why this case matters
Models a redirect controller decision before following a target or exposing a redirect result.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and size != 0, ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | {'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/0'} | {'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/0'} | Passed |
| fixture 2 | {'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'Transfer-Encoding': 'chunked', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/1'} | {'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'Transfer-Encoding': 'chunked', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/1'} | Passed |
| fixture 3 | {'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | {'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | Passed |
| fixture 4 | {'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/3'} | {'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/3'} | Passed |
| fixture 5 | {'decision': [{'X': 'keep'}, 'B', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/4'} | {'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/4'} | Failed |
| fixture 6 | {'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | {'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | Passed |
SHA-256 / 8d86cff85e2ea710ac713b7a58d9df2a36cd75d2915be4be70bf66f183dec359
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD'), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | {'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/0'} | {'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/0'} | Passed |
| fixture 2 | {'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'Transfer-Encoding': 'chunked', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/1'} | {'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'Transfer-Encoding': 'chunked', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/1'} | Passed |
| fixture 3 | {'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | {'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | Passed |
| fixture 4 | {'decision': [{}, 'B', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/3'} | {'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/3'} | Failed |
| fixture 5 | {'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/4'} | {'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/4'} | Passed |
| fixture 6 | {'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | {'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | Passed |
SHA-256 / ed44529e81258652d623f197eba54fb44c8fb870e7d1448f48f17d5faabbb242
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | {'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/0'} | {'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/0'} | Passed |
| fixture 2 | {'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'Transfer-Encoding': 'chunked', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/1'} | {'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'Transfer-Encoding': 'chunked', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/1'} | Passed |
| fixture 3 | {'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | {'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | Passed |
| fixture 4 | {'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/3'} | {'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/3'} | Passed |
| fixture 5 | {'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/4'} | {'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length'], 'request': '/requests/1/4'} | Passed |
| fixture 6 | {'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | {'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | Passed |
SHA-256 / 7b6d0a6252d14fc9c401019e4b698a3555cc548c381211b825020fbe79c427af
Verification & scope
Stipulated offline redirect policy, not a complete HTTP, browser, URL, cache, or security implementation. Numbered variants vary request correlation identity. 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:29.876807+00:00.
Case digest / 3a6c36d996a526db758a417b33510482db67fd155a15b98577024ce98ebbb8dc