Write gzip footer for resource-collection.js.gz#66242
Merged
Conversation
1 task
Copilot
AI
changed the title
[WIP] Fix missing GZIP footer in resource-collection.x.js
Write gzip footer for resource-collection.js.gz
Apr 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes generation of resource-collection.js.gz so the gzip trailer/footer is included before the payload is cached and served, preventing clients/tools from treating the response as truncated.
Changes:
- Dispose
GZipStreambefore reading from the underlyingMemoryStreamto ensure the gzip footer is written. - Add an endpoint-focused test that requests the
.js.gzendpoint, decompresses it, and verifies it matches the uncompressed.jsendpoint output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Components/Endpoints/src/Builder/ResourceCollectionUrlEndpoint.cs | Ensures gzip bytes are materialized only after GZipStream disposal so the trailer is present. |
| src/Components/Endpoints/test/Builder/ResourceCollectionUrlEndpointTest.cs | Adds coverage validating the .js.gz response fully decompresses and matches the uncompressed payload. |
3 tasks
Agent-Logs-Url: https://github.com/dotnet/aspnetcore/sessions/b7b5acc8-c8fb-438d-bbe5-6bd57c3eff13 Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
c8bcf80 to
0ebb21c
Compare
maraf
approved these changes
Apr 9, 2026
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
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.
Write gzip footer for resource-collection.js.gz
Ensure resource-collection gzip payloads include the footer
Description
The generated
resource-collection.js.gzpayload was read beforeGZipStreamdisposal completed, so the gzip footer was omitted and some clients/tools rejected the response as truncated.Runtime fix
CreateGzipBytesto disposeGZipStreambefore reading the underlyingMemoryStream.Coverage
.js.gzroute.resource-collection.jspayload.