fix: allow file:// URLs with --url option#754
Merged
Conversation
c8a13aa to
edcd021
Compare
edcd021 to
76906d6
Compare
Altahrim
approved these changes
May 13, 2026
curl returns HTTP code 0 for file:// (no HTTP involved), causing the download step to incorrectly treat a successful local file copy as a failure. Skip the HTTP code check when the URL uses the file:// scheme. Add Behat scenarios covering the happy path (--no-verify) and the missing-signature error for local file URLs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
76906d6 to
aee05a4
Compare
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
aee05a4 to
469a801
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CURLINFO_HTTP_CODEreturns0forfile://URLs (curl handles them directly, no HTTP involved). The download step checked$httpCode !== 200 && $httpCode !== 206, so it always treated a successful local file copy as a failure and reported "All downloads failed."Fix: skip the HTTP code check when the URL scheme is
file://.Affects both
lib/Updater.php(CLI) andindex.php(web updater).Why
Useful for testing upgrades offline or in air-gapped environments where the archive is already present on the server.
Usage:
Note:
--no-verifyor--signatureis still required when using--url(unchanged behaviour — the error message already explains this).Tests
Two new Behat scenarios in
tests/features/cli.feature:Update via local file URL with --no-verify— verifies the full upgrade succeedsUpdate via local file URL without --no-verify fails— verifies the existing signature-required error is still raisedSteps to reproduce (before fix)