-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[release/10.0.1xx] [BrowserRefresh] Handle gzip-compressed responses in ResponseStreamWrapper #50535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MackinnonBuck
merged 16 commits into
release/10.0.1xx
from
backport/pr-50452-to-release/10.0.1xx
Sep 4, 2025
Merged
[release/10.0.1xx] [BrowserRefresh] Handle gzip-compressed responses in ResponseStreamWrapper #50535
MackinnonBuck
merged 16 commits into
release/10.0.1xx
from
backport/pr-50452-to-release/10.0.1xx
Sep 4, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: javiercn <[email protected]>
…n every write Co-authored-by: javiercn <[email protected]>
…ttern Co-authored-by: javiercn <[email protected]>
We know the contents of the temporary buffer will always be a substring of the expected body tag, so there's no reason to maintain a separate temporary buffer.
tmat
approved these changes
Aug 28, 2025
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
javiercn
approved these changes
Aug 29, 2025
@marcpopMSFT This was approved in tactics - are we clear to merge into the |
If it's tactics approved then yes. RC2 is open for merges. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #50452 to release/10.0.1xx
Handle gzip-compressed responses in ResponseStreamWrapper
Updates hot reload middleware to decompress a compressed response body before attempting to perform script injection.
Description
This PR fixes an issue where hot reload middleware corrupts the response body when a static HTML file gets served using
MapStaticAssets()
.The bug occurs due to a combination of factors:
</body>
tag and insert a<script>
into the response.To address this problem, there are two high-level changes in this PR:
</body>
tag is split between multiple writes to the response stream (long-standing issue)Fixes #50451
Fixes dotnet/aspnetcore#58940
Customer Impact
Customers impacted by this bug will experience the browser failing to load pages served via
MapStaticAssets()
. They will need to perform one of the following workarounds during development:Many customers have reported running into the bug since it was introduced in .NET 9. At the time of writing, dotnet/aspnetcore#58940 has at least 11 reactions from the community.
Regression?
This bug has existed since the introduction of
MapStaticAssets()
in .NET 9. However, it blocks many customers from migrating away from the older static files middleware.Risk
The feature has thorough automated tests. Manual validation has also confirmed that:
Verification
Packaging changes reviewed?