FAILURE MAP
← Case archive

FA-27861 / HTTP redirects / Open access

Select an unambiguous Location field without losing raw syntax: missing vs empty · case 01

An empty field is confused with an absent field.

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

ROOT CAUSE

The missing-vs-empty decision uses "'present' if any(v for k,v in lines if k.lower() == 'location') else 'missing'"; this violates the stipulated controller policy.

VERIFIED REPAIR

At this decision use "'missing' if not any(k.lower() == 'location' for k,v in lines) else 'present'", preserving the other controller outputs.

Unsuccessful approach: The partial repair uses "'present' if lines else 'missing'" and still fails an explicit boundary or control.

Case contract

Select an unambiguous Location field without losing raw syntax. 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, lines):
    return {'request': request, 'decision': [[v for k,v in lines if k.lower() == 'location'], len([v for k,v in lines if k.lower() == 'location']) > 1, [v.strip(' \t') for k,v in lines if k.lower() == 'location'], [v for k,v in lines if k.lower() == 'location'], 'present' if any(v for k,v in lines if k.lower() == 'location') else 'missing']} 
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', [('Location', ' /a,b '), ('X', 'z')]), {'request': '/requests/' + str(N) + '/0', 'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [('location', '/a b')]), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [('LOCATION', '')]), {'request': '/requests/' + str(N) + '/2', 'decision': [[''], False, [''], [''], 'present']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [('X', 'z')]), {'request': '/requests/' + str(N) + '/3', 'decision': [[], False, [], [], 'missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [('Location', '/a'), ('location', '/b')]), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present']})
check('fixture 6', solve('/requests/' + str(N) + '/5', []), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, [], [], 'missing']})
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 1{'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present'], 'request': '/requests/1/0'}{'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present'], 'request': '/requests/1/0'}Passed
fixture 2{'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present'], 'request': '/requests/1/1'}{'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present'], 'request': '/requests/1/1'}Passed
fixture 3{'decision': [[''], False, [''], [''], 'missing'], 'request': '/requests/1/2'}{'decision': [[''], False, [''], [''], 'present'], 'request': '/requests/1/2'}Failed
fixture 4{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/3'}{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/3'}Passed
fixture 5{'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present'], 'request': '/requests/1/4'}{'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present'], 'request': '/requests/1/4'}Passed
fixture 6{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/5'}{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/5'}Passed

SHA-256 / db247d807719c1ce8fc4f1880394d300df73400cc032b30817a3b11e2b239faf

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, lines):
    return {'request': request, 'decision': [[v for k,v in lines if k.lower() == 'location'], len([v for k,v in lines if k.lower() == 'location']) > 1, [v.strip(' \t') for k,v in lines if k.lower() == 'location'], [v for k,v in lines if k.lower() == 'location'], 'present' if lines else 'missing']} 
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', [('Location', ' /a,b '), ('X', 'z')]), {'request': '/requests/' + str(N) + '/0', 'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [('location', '/a b')]), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [('LOCATION', '')]), {'request': '/requests/' + str(N) + '/2', 'decision': [[''], False, [''], [''], 'present']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [('X', 'z')]), {'request': '/requests/' + str(N) + '/3', 'decision': [[], False, [], [], 'missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [('Location', '/a'), ('location', '/b')]), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present']})
check('fixture 6', solve('/requests/' + str(N) + '/5', []), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, [], [], 'missing']})
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 1{'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present'], 'request': '/requests/1/0'}{'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present'], 'request': '/requests/1/0'}Passed
fixture 2{'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present'], 'request': '/requests/1/1'}{'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present'], 'request': '/requests/1/1'}Passed
fixture 3{'decision': [[''], False, [''], [''], 'present'], 'request': '/requests/1/2'}{'decision': [[''], False, [''], [''], 'present'], 'request': '/requests/1/2'}Passed
fixture 4{'decision': [[], False, [], [], 'present'], 'request': '/requests/1/3'}{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/3'}Failed
fixture 5{'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present'], 'request': '/requests/1/4'}{'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present'], 'request': '/requests/1/4'}Passed
fixture 6{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/5'}{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/5'}Passed

SHA-256 / e3b3a72df03abbeeef1f0df66f01453f7bafb5565d3c0c9f019392a145a82c03

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, lines):
    return {'request': request, 'decision': [[v for k,v in lines if k.lower() == 'location'], len([v for k,v in lines if k.lower() == 'location']) > 1, [v.strip(' \t') for k,v in lines if k.lower() == 'location'], [v for k,v in lines if k.lower() == 'location'], 'missing' if not any(k.lower() == 'location' for k,v in lines) else 'present']} 
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', [('Location', ' /a,b '), ('X', 'z')]), {'request': '/requests/' + str(N) + '/0', 'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [('location', '/a b')]), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [('LOCATION', '')]), {'request': '/requests/' + str(N) + '/2', 'decision': [[''], False, [''], [''], 'present']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [('X', 'z')]), {'request': '/requests/' + str(N) + '/3', 'decision': [[], False, [], [], 'missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [('Location', '/a'), ('location', '/b')]), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present']})
check('fixture 6', solve('/requests/' + str(N) + '/5', []), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, [], [], 'missing']})
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 1{'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present'], 'request': '/requests/1/0'}{'decision': [[' /a,b '], False, ['/a,b'], [' /a,b '], 'present'], 'request': '/requests/1/0'}Passed
fixture 2{'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present'], 'request': '/requests/1/1'}{'decision': [['/a b'], False, ['/a b'], ['/a b'], 'present'], 'request': '/requests/1/1'}Passed
fixture 3{'decision': [[''], False, [''], [''], 'present'], 'request': '/requests/1/2'}{'decision': [[''], False, [''], [''], 'present'], 'request': '/requests/1/2'}Passed
fixture 4{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/3'}{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/3'}Passed
fixture 5{'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present'], 'request': '/requests/1/4'}{'decision': [['/a', '/b'], True, ['/a', '/b'], ['/a', '/b'], 'present'], 'request': '/requests/1/4'}Passed
fixture 6{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/5'}{'decision': [[], False, [], [], 'missing'], 'request': '/requests/1/5'}Passed

SHA-256 / 1eaeb7ff007000e5aeef3a6be05b0b42cc1dd54fd647a89b3d9aeb368a85668e

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

Case digest / 7bb1cb19d4960f25eb16ad8fbd35ffcba73b043258c660d68676b6a6fe227908