Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

If the configuration doesn't come with headers, don't waste memory cr…

…eating a header object
  • Loading branch information...
commit eb32dd55c744d3b449cea27fc785ea4ee0fc0827 1 parent a1f2263
@partheseas authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 trailer.js
View
6 trailer.js
@@ -112,9 +112,7 @@ tl.hitch = function ( conf ) {
return false
}
- !conf.headers&&( conf.headers = {} )
-
- for ( prop in basics.headers ) if ( basics.headers.hasOwnProperty( prop ) && !conf.headers.hasOwnProperty( prop ) ) {
+ if ( conf.headers ) for ( prop in basics.headers ) if ( basics.headers.hasOwnProperty( prop ) && !conf.headers.hasOwnProperty( prop ) ) {
conf.headers[ prop ] = basics.headers[ prop ]
}
@@ -286,7 +284,7 @@ server.on( "request", function ( i, o ) {
o.emitter = i.conf._emitter,
o.stream = o,
o.status = 500,
- o.headers = Object.copy( i.conf.headers )
+ o.headers = Object.copy( i.conf.headers || basics.headers )
o.body = "";
o.headers.Date = i.received.toUTCString()
Please sign in to comment.
Something went wrong with that request. Please try again.