test(gitstat): strip CGI headers before parsing the detail payload
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-12 09:54:41
Commit9669b1e7
Parentsd6f3368a
Changed files
tests/run.sh+3−3■■■■■
1 file+3−3
Diff
tests/run.sh+3−3■■■■■
index 7336499..8f40cc3 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -303,9 +303,9 @@ d=json.load(sys.stdin)
303303 print(json.dumps([r for r in d['repos'] if r['name']=='secretremote'][0]))")
304304 check_not "credential in the origin URL is redacted (token)" "planttoken123" "$SEC"
305305 check_not "credential in the origin URL is redacted (user)" "plantuser" "$SEC"
306-SECUREMOTE=$(env QUERY_STRING="action=repo&path=$ROOTS/secretremote" \
307- GITSTAT_ONLY_ROOTS=1 GITSTAT_ROOTS="$ROOTS" $BIN | body)
308-check "the board row does not pay for the origin URL" "\"remote\":\"\"" "$SEC"
306+SECUREMOTE=$(body "$(env QUERY_STRING="action=repo&path=$ROOTS/secretremote" \
307+ GITSTAT_ONLY_ROOTS=1 GITSTAT_ROOTS="$ROOTS" $BIN)")
308+check "the board row does not pay for the origin URL" '"remote": ""' "$SEC"
309309 json_ok "the detail reads the origin URL" "$SECUREMOTE" \
310310 "d['repo']['remote']=='https://example.invalid/x.git'"
311311 check_not "the detail remote carries no userinfo" "plantuser" "$SECUREMOTE"
312312
tests/run.sh+3−3■■■■■
index 7336499..8f40cc3 100755index 7336499..8f40cc3 100755
--- a/tests/run.sh--- a/tests/run.sh
+++ b/tests/run.sh+++ b/tests/run.sh
@@ -303,9 +303,9 @@ d=json.load(sys.stdin)@@ -303,9 +303,9 @@ d=json.load(sys.stdin)
303 print(json.dumps([r for r in d['repos'] if r['name']=='secretremote'][0]))")303 print(json.dumps([r for r in d['repos'] if r['name']=='secretremote'][0]))")
304 check_not "credential in the origin URL is redacted (token)" "planttoken123" "$SEC"304 check_not "credential in the origin URL is redacted (token)" "planttoken123" "$SEC"
305 check_not "credential in the origin URL is redacted (user)" "plantuser" "$SEC"305 check_not "credential in the origin URL is redacted (user)" "plantuser" "$SEC"
306-SECUREMOTE=$(env QUERY_STRING="action=repo&path=$ROOTS/secretremote" \306+SECUREMOTE=$(body "$(env QUERY_STRING="action=repo&path=$ROOTS/secretremote" \
307- GITSTAT_ONLY_ROOTS=1 GITSTAT_ROOTS="$ROOTS" $BIN | body)307+ GITSTAT_ONLY_ROOTS=1 GITSTAT_ROOTS="$ROOTS" $BIN)")
308-check "the board row does not pay for the origin URL" "\"remote\":\"\"" "$SEC"308+check "the board row does not pay for the origin URL" '"remote": ""' "$SEC"
309 json_ok "the detail reads the origin URL" "$SECUREMOTE" \309 json_ok "the detail reads the origin URL" "$SECUREMOTE" \
310 "d['repo']['remote']=='https://example.invalid/x.git'"310 "d['repo']['remote']=='https://example.invalid/x.git'"
311 check_not "the detail remote carries no userinfo" "plantuser" "$SECUREMOTE"311 check_not "the detail remote carries no userinfo" "plantuser" "$SECUREMOTE"
312312