FA-27971 / HTTP redirects / Open access
Prepare upload metadata and handoff sequencing after a redirect decision: multipart wire boundary · case 01
Reconstructing multipart headers chooses a new boundary although the replayed wire bytes still contain the old boundary.
ROOT CAUSE
The multipart-wire-boundary decision uses 'next_boundary'; this violates the stipulated controller policy.
VERIFIED REPAIR
At this decision use 'next_boundary if changed else boundary', preserving the other controller outputs.
Unsuccessful approach: The partial repair uses 'boundary' 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, 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'}, 'B', 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'} | Failed |
| 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': [{}, 'C', False, ['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'}, 'C', False, ['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': [{}, 'Y', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | {'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none'], 'request': '/requests/1/5'} | Failed |
SHA-256 / 6c4c6fa9741b64fc94c6d16145f5299e6f49217d16606020a3103ed00b14fd74
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'))}, 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'}, 'A', 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'} | Failed |
| 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': [{}, 'B', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | {'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked'], 'request': '/requests/1/2'} | Failed |
| 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 / d1458f46b7daa3c9b8416b1e75c16a7f05dbf753e00d87c21c36cdd40da199c6
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.836463+00:00.
Case digest / ab6d02b3bcf79bd37bc8525044eae710f0dec5cb9d9cb1d6d5aae3b02a60b4b2