File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ function compression (options) {
9090 return false
9191 }
9292
93- if ( ! headersSent ( res ) ) {
93+ if ( ! res . headersSent ) {
9494 this . writeHead ( this . statusCode )
9595 }
9696
@@ -104,7 +104,7 @@ function compression (options) {
104104 return false
105105 }
106106
107- if ( ! headersSent ( res ) ) {
107+ if ( ! res . headersSent ) {
108108 // estimate the length
109109 if ( ! this . getHeader ( 'Content-Length' ) ) {
110110 length = chunkLength ( chunk , encoding )
@@ -298,17 +298,3 @@ function toBuffer (chunk, encoding) {
298298 ? chunk
299299 : Buffer . from ( chunk , encoding )
300300}
301-
302- /**
303- * Determine if the response headers have been sent.
304- *
305- * @param {object } res
306- * @returns {boolean }
307- * @private
308- */
309-
310- function headersSent ( res ) {
311- return typeof res . headersSent !== 'boolean'
312- ? Boolean ( res . _header )
313- : res . headersSent
314- }
You can’t perform that action at this time.
0 commit comments