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

Fix broken license downloads from GitHub #89

Merged
merged 5 commits into from
Sep 30, 2024

Conversation

mtnpke
Copy link

@mtnpke mtnpke commented Sep 27, 2024

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.

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.
@sensslen
Copy link
Owner

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....

@mtnpke
Copy link
Author

mtnpke commented Sep 27, 2024

Of course! It will look like this for, for example, System.Buffers with license URL https://github.com/dotnet/corefx/blob/master/LICENSE.TXT

image

Copy link
Owner

@sensslen sensslen left a 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.

Copy link

sonarcloud bot commented Sep 30, 2024

@sensslen sensslen merged commit 0b953e0 into sensslen:main Sep 30, 2024
21 checks passed
@sensslen
Copy link
Owner

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

@mtnpke
Copy link
Author

mtnpke commented Sep 30, 2024

Great, thanks! Have a nice week.

@mtnpke mtnpke deleted the fix-broken-github-licenses branch September 30, 2024 14:58
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.

2 participants