[release/9.0] Return 206 Partial Content on Valid Range for Static Assets #59325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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