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

add inflate-deflate support #137

Merged
merged 1 commit into from
Mar 4, 2024
Merged
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
13 changes: 10 additions & 3 deletions src/http/readable-stream/_stream_passthrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ class PassThrough extends Transform {
constructor (options) {
super(options);
this.ee = new EventEmitter();
if (options.headers && options.headers['content-encoding'] && isEqual(options.headers['content-encoding'].toLowerCase(), 'gzip')) {
this.isGzip = true;
this.inflator = new pako.Inflate();
if (options.headers) {
if (options.headers['content-encoding']) {
if (
isEqual(options.headers['content-encoding'].toLowerCase(), 'gzip') ||
isEqual(options.headers['content-encoding'].toLowerCase(), 'deflate')
) {
this.isGzip = true;
this.inflator = new pako.Inflate();
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/http/ziti-inner-tls-socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class ZitiInnerTLSSocket extends EventEmitter {
// ...then indicate we have a pending 'close' event. The 'close' event will be emitted by the ClientRequest
// when it runs and sees the need to emit the event. We need to defer/delay the emission of the 'close'
// event because it is possible that the data for this connection hasn't completed the decrypt flow yet,
// and thus the HTTP Response pqrsing logic hasn't run yet, and if we issue a 'close' before then, the
// and thus the HTTP Response parsing logic hasn't run yet, and if we issue a 'close' before then, the
// HTTP Response parsing logic will interpret the close as a 'socket hang up' error.

this._closeEventPending = true;
Expand Down
Loading