[release/9.0] Return 206 Partial Content on Valid Range for Static Assets by github-actions[bot] · Pull Request #59325 · dotnet/aspnetcore (original) (raw)

Backport of #59160 to release/9.0

/cc @javiercn @melotic

Return 206 Partial Content on Valid Range for Static Assets

Fixes an issue where range requests resulted in a 416 error.

Description

The status code that we were returning was incorrect. The fix corrects the behavior and includes the appropriate test to cover the scenario.

Fixes #58829

Customer Impact

Customers can't serve media content (video, audio) as the browser issues a range request for it, and the result has the wrong status code. This only applies when using the new MapStaticAssets API introduced in .NET 9, so customers will only be impacted if they manually updated their app to use the new API, or if they created their project from a .NET 9 project template.

Regression?

The bug only occurs when using a newly introduced API in .NET 9.

Risk

The fix is simple, it has automated tests, and it has been manually validated.

Verification

Packaging changes reviewed?


When servicing release/2.1