diff --git a/src/http/readable-stream/_stream_passthrough.js b/src/http/readable-stream/_stream_passthrough.js index 4199542..93ddbc6 100644 --- a/src/http/readable-stream/_stream_passthrough.js +++ b/src/http/readable-stream/_stream_passthrough.js @@ -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(); + } + } } } diff --git a/src/http/ziti-inner-tls-socket.js b/src/http/ziti-inner-tls-socket.js index d282a32..0625839 100644 --- a/src/http/ziti-inner-tls-socket.js +++ b/src/http/ziti-inner-tls-socket.js @@ -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;