NuGet / NuGetGallery

NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
https://www.nuget.org/
Apache License 2.0
1.52k stars 643 forks source link

Allow images from media.githubusercontent.com #9857

Closed pascalberger closed 3 months ago

pascalberger commented 3 months ago

Allow LFS tracked images from GitHub repositories which are served on media.githubusercontent.com

Fixes https://github.com/NuGet/NuGetGallery/issues/9856

erdembayar commented 3 months ago

@lyndaidaii Could you please take a look into this PR?

lyndaidaii commented 3 months ago

@pascalberger, could you please provide one badge/image example with media.githubusercontent.com? we need go over some security perspective before allow this domain on NuGet.org.
Does your package on NuGet.org can't display image due to this domain? could you please also provide package link? Thanks!

pascalberger commented 3 months ago

@lyndaidaii See https://github.com/swissgrc/Statiq.Alerts/blob/develop/README.md, which is a readme that is packaged into a NuGet package. It contains some images showcasing features of the package, which are stored in the same repository. Because the images are stored using Git LFS (to avoid bloating the repository) this won't work since LFS tracked files will get a different URL (media.githubusercontent.com) than non LFS tracked files (raw.githubusercontent.com)

lyndaidaii commented 3 months ago

Thank you for providing details. Verified on my end.

lyndaidaii commented 3 months ago

running NuGetGallery CI.