Skip to content

fix(scripts): read source URL status from curl - #44

Merged
noctuum merged 1 commit into
mainfrom
fix/source-url-status
Oct 20, 2026
Merged

noctuum merged 1 commit into
mainfrom
fix/source-url-status

Conversation

@noctuum

@noctuum noctuum commented Oct 20, 2026

Copy link
Copy Markdown
Member

validate_source_urls took the HTTP status from the last line that starts with HTTP/ and compared it with [[ ... -ge 400 ]]. bash evaluates that operand as arithmetic, and an array subscript in it runs a command. The server of a source, a host it redirects to, or anyone on the path of an http:// source could answer the HEAD request with a line such as HTTP/1.1: BASH_VERSINFO[$(id>file)] and run id in prepare, or on the machine that runs update-pkg.sh without --prepare.

curl now reports the status and the Content-Type of the last response through -w, and a status that is not three digits fails the check. text/html matches in any letter case.

bats tests/ --recursive: 431 pass.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@noctuum
noctuum merged commit 2031e1a into main Oct 20, 2026
5 checks passed
@noctuum
noctuum deleted the fix/source-url-status branch October 20, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant