-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix broken license downloads from GitHub #89
Conversation
When a license is linked to a file on GitHub, the downloaded HTML will not be usable. Instead, detect those URLs and download the raw file instead. This file will usually be a text file and not HTML, so make sure that the correct extension is used in this case.
Can you please explain what you mean with "not usable"? I'm generally hesitant to include such special cases and giving an explanation that provides data will help me make a judgement call either way.... |
Of course! It will look like this for, for example, System.Buffers with license URL https://github.com/dotnet/corefx/blob/master/LICENSE.TXT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through this in more detail, I think we can live with this special case, as github is such a common place to store code on and a lot of nuget packages are developed on github. However I would encourage you to add thorough unit tests for this functionality.
Quality Gate passedIssues Measures |
I just merged this PR into the main branch. This means the fix will end up in the next release. Thank you so much for your contribution @mtnpke |
Great, thanks! Have a nice week. |
When a license is linked to a file on GitHub, the downloaded HTML will not be usable. Instead, detect those URLs and download the raw file instead. This file will usually be a text file and not HTML, so make sure that the correct extension is used in this case.