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

[Feature]: Allowed domains for images - github.com/...?raw=true #9756

Open ricaun opened 7 months ago

ricaun commented 7 months ago

Related Problem

I'm trying to show a simple banner in my Nuget packages and found out that there exists a white list.

https://learn.microsoft.com/en-us/nuget/nuget-org/package-readme-on-nuget-org#allowed-domains-for-images-and-badges

By using the raw.githubusercontent works like expected.

![Banner](https://raw.githubusercontent.com/ricaun/test-assets/main/Banner.png)

I tried to use the blob version with the raw=true that gonna redirect to the same raw.githubusercontent image. That does not work and does not show the image.

![Banner](https://github.com/ricaun/test-assets/blob/main/Banner.png?raw=true)

The Elevator Pitch

Because the raw=true redirects to the domain raw.githubusercontent.

I wonder if there is a possibility to allow the github.com/...?raw=true.

So both approaches would work.

Additional Context and Details

No response