Skip to content
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

fix sitemap.xml.gz not is not compressed #4622 #4661

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/4661.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix sitemap.xml.gz not is not compressed @dobri1408
2 changes: 1 addition & 1 deletion src/express-middleware/sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const sitemap = function (req, res, next) {
generateSitemap(req).then((sitemap) => {
if (Buffer.isBuffer(sitemap)) {
res.set('Content-Type', 'application/x-gzip');
res.set('Content-Encoding', 'gzip');
res.set('Content-Encoding', 'compress');
Copy link
Member

Choose a reason for hiding this comment

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

@dobri1408 This isn't correct either. We need to remove the Content-Encoding header entirely. Because the gzip compression is supposed to remain after the file is downloaded, not only during transfer.

res.set('Content-Disposition', 'attachment; filename="sitemap.xml.gz"');
res.send(sitemap);
} else {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19853,7 +19853,7 @@ __metadata:
dependencies:
prop-types: ^15.7.2
peerDependencies:
react-intl: ^2.2.2 || ^3.0.0
react-intl: ^2.2.2 || ^3.0.0
react-redux: ^5.0.1 || ^6.0.0 || ^7.0.0
checksum: eece9837c7b97581961732168b2e286e771ad4104bdde94caf3ce61ef51d8daa64b4365d4353901029a0cfa91c411a5149ff8bf0a89ac94eebce93982e1cb0f4
languageName: node
Expand Down Expand Up @@ -25446,4 +25446,4 @@ __metadata:
resolution: "zwitch@npm:1.0.5"
checksum: 28a1bebacab3bc60150b6b0a2ba1db2ad033f068e81f05e4892ec0ea13ae63f5d140a1d692062ac0657840c8da076f35b94433b5f1c329d7803b247de80f064a
languageName: node
linkType: hard
linkType: hard