-
Notifications
You must be signed in to change notification settings - Fork 41
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
gzip support? #17
Comments
The server must have a weird configuration. I'd look into zlib, it is built into node.js (at least for 0.10 and 0.12). This sounds like an useful thing to support out of the box. Sorry I don't have time to work on it right now! We can leave the issue open for when I have time to get to it. |
yes, server does not serve the file non-zipped for some reason. I ended up using request |
Do you have any plans to add gzip support to this library? Thank you. |
Angular's Server Side rendering depends on this project and requires GZIP support :( |
For Angular folks -- I'm at Google now, so I could justify spending some time on this if it's helpful to Angular. Please reach out to me if you'd like to discuss. |
The Angular SSR can have tangible benefit receiving gzipped content as the remote requests are probably the slowest part of our project. |
I patched this into my own implementation with the following diff at Testim: } else {
buffer = this._concatBuffers(this._responseParts);
}
+ // temporary workaround for transport encoding parsing
+ if (this._responseHeaders['content-encoding'] && this._responseHeaders['content-encoding'] === 'gzip') {
+ buffer = require('zlib').gunzipSync(buffer);
+ }
+ console.log('response parse', this._responseHeaders);
this._responseParts = null;
switch (this.responseType) {
case 'text': Feel free to use this (it's very basic and mostly incorrect since it doesn't stream the zipped data), a more correct implementation would reuse the logic for this from superagent or request. It worked for me, feel free to use this. |
Can you please explain where/how this should be applied? |
This is a diff file, you can typically apply it with the |
I understand. but which file? |
I figured it out. I used the script patching to apply the patch after npm install. |
Is this still not supported by Angular Universal? I need to know if i understand correctly: Angular Universal use xhr2 for all requests, and xhr2 not support gzip, thats what my ssr refuse "Accept-Encoding" header, i'm right? |
Now, the real question is - does |
I checked xhr2 used in angular 9 universal and it still doesn’t support gzip decompression. I had to create a new patch file and use it in our build process. |
I was getting 404 for some file before I did this
Now I don't get 404, but the data is obviously garbage. Is there easy way to get unzipped content in this case?
The text was updated successfully, but these errors were encountered: