Skip to content

Conversation

melotic
Copy link
Member

@melotic melotic commented Nov 26, 2024

Currently, static assets returns a 416 Range Not Satisfiable when given a satisfiable range instead of a 206 Partial Content.

Fixes the bug and adds a test for it.

Fixes #58829


Additionally, the current logic doesn't return a 416 when the supplied range is unsatisfiable. I'll file a separate issue and PR.

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Nov 26, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 26, 2024
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@melotic
Copy link
Member Author

melotic commented Nov 26, 2024

@javiercn could you merge? I don't have permissions. Thanks

@javiercn javiercn merged commit 3a87639 into dotnet:main Nov 26, 2024
27 checks passed
@javiercn
Copy link
Member

@melotic thanks for the contribution!

@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Nov 26, 2024
@melotic
Copy link
Member Author

melotic commented Dec 4, 2024

@javiercn Thanks for the review + merge! This is an awesome feature.

I'm not familiar with the ASP.NET Core release process, but is there any chance of a bug fix release with this PR?

This is currently preventing us from enabling caching with Azure Front Door since it fetches contents in ranges. 1 The backend returns a 416 from this bug, which AFD happily forwards to clients 😢

Footnotes

  1. https://learn.microsoft.com/en-us/azure/frontdoor/front-door-caching?pivots=front-door-standard-premium#delivery-of-large-files

@javiercn
Copy link
Member

javiercn commented Dec 5, 2024

@melotic I'll try to bring this for the next patch release, however, bear in mind the holidays are approaching.

@javiercn
Copy link
Member

javiercn commented Dec 5, 2024

/backport to release/9.0

Copy link
Contributor

github-actions bot commented Dec 5, 2024

Started backporting to release/9.0: https://github.com/dotnet/aspnetcore/actions/runs/12174988321

captainsafia pushed a commit that referenced this pull request Feb 11, 2025
…Assets (#59160)

* Return 206 Partial Content on Valid Range for Static Assets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading an mp4 video static asset in Blazor returns http 416 error
2 participants