Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow redirects before getting PharVersion #302

Open
heiglandreas opened this issue Jan 31, 2021 · 2 comments
Open

Follow redirects before getting PharVersion #302

heiglandreas opened this issue Jan 31, 2021 · 2 comments

Comments

@heiglandreas
Copy link
Contributor

Currently getPharVersion tries to get the actual PHAR-Version from the provided URL.

If one uses a service that resolves a certain version-constraint and then redirects to the last version matching that constraint the provided URL might not match the regular expressions in that function and result in an inabillity to install the tool.

Either we need to make these regexes much mor elax or resolve the regex after following all redirects to the final download URL and then apply those regexes to that final URL.

Concrete case is that I'm not able to install via phive install "https://api.getlatestassets.com/github/Behat/Behat/behat.phar?version=^3.0" which resolves to https://github.com/Behat/Behat/releases/download/v3.8.1/behat.phar

@heiglandreas
Copy link
Contributor Author

The issue seems also to be that the URL https://github.com/Behat/Behat/releases/download/v3.8.1/behat.phar also does not match the regex as the regex exptects either *-major.minor.patch* or /major.minor.patch/. But the /v3.8.1/ doesn't match either...

@theseer
Copy link
Member

theseer commented Jan 31, 2021

sigh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants