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) {
90
90
return false
91
91
}
92
92
93
- if ( ! headersSent ( res ) ) {
93
+ if ( ! res . headersSent ) {
94
94
this . writeHead ( this . statusCode )
95
95
}
96
96
@@ -104,7 +104,7 @@ function compression (options) {
104
104
return false
105
105
}
106
106
107
- if ( ! headersSent ( res ) ) {
107
+ if ( ! res . headersSent ) {
108
108
// estimate the length
109
109
if ( ! this . getHeader ( 'Content-Length' ) ) {
110
110
length = chunkLength ( chunk , encoding )
@@ -298,17 +298,3 @@ function toBuffer (chunk, encoding) {
298
298
? chunk
299
299
: Buffer . from ( chunk , encoding )
300
300
}
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