-
-
Notifications
You must be signed in to change notification settings - Fork 707
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
Conversation
✅ Deploy Preview for volto canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ file sitemap.xml.gz
sitemap.xml.gz: gzip compressed data, from Unix, original size modulo 2^32 423340
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it work with gz
and not gzip
? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding mentions gzip
but not gz
@avoinea How did you retrieve the file for the test? The success may depend on the specifics of the tool you used and how it interprets the header. |
Maybe that's why it works now. As |
@avoinea Ah, that's it.
We should just not set |
@@ -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'); |
There was a problem hiding this comment.
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.
@davisagli Thank you for the review |
Fixes #4622