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

proper encoding "+" in package download url #2288

Merged
merged 2 commits into from Apr 26, 2017

Conversation

bigbearzhu
Copy link

@bigbearzhu bigbearzhu commented Apr 26, 2017

Should fix #2261 properly. Encode "+" only in base url not query string. And encode when the download link is just fetched.
See https://dotnetfiddle.net/7RwLPU for what the encodeURL does.
Also there is another bug in SemVer.Parse that parse the prerelease incorrectly when metadata is used. e.g. 2.0.54674-master+d277eaf would have master+ as prerelease, but it should be master.

@bigbearzhu bigbearzhu changed the title proper fix for bug 2261 proper fix for bug #2261 Apr 26, 2017
@bigbearzhu bigbearzhu changed the title proper fix for bug #2261 proper encoding "+" in package download url Apr 26, 2017
@matthid
Copy link
Member

matthid commented Apr 26, 2017

Its probably fine as it is but I'd really like to see unit tests for this. Do you feel like you could add some? Tbh we should have added them right away...

@forki
Copy link
Member

forki commented Apr 26, 2017

since this is better than what we have and actually fixes a bug I'm willing to merge it now. But please send a nother PR with a unit test. Thx

@forki forki merged commit ecf5ccb into fsprojects:master Apr 26, 2017
@bigbearzhu
Copy link
Author

Thanks for quick merge. I tried to add some test before sending the pull request, didn't find existing tests for either NuGetV2.fs or SemVer.fs. The SemVerTests.cs seems is for the bootstrapper only. Mind pointing me to the right place/way? I only use F# occasionally, not very good at doing big refactoring jobs.

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.

Can't download package with '+' in version string from TeamCity
3 participants