Skip to content
Prev Previous commit
Next Next commit
Add support for http2
The change just removes the usage of undocumented http API and instead uses the proper writeHead method
  • Loading branch information
Moritz Peters authored and maritz committed Sep 26, 2018
commit 6e1ae362b5f8b4f3b1ac801d93cbf64e340d0a51
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function compression (options) {
}

if (!this._header) {
this._implicitHeader()
this.writeHead(this.statusCode)
}

return stream
Expand All @@ -100,7 +100,7 @@ function compression (options) {
length = chunkLength(chunk, encoding)
}

this._implicitHeader()
this.writeHead(this.statusCode)
}

if (!stream) {
Expand Down