Skip to content

Commit

Permalink
Make a separate env object instance per request.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Dec 16, 2011
1 parent 5015afe commit 2d2ad38
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jsgi-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ Request.prototype = {
flush: function(){}
}
},
env:{},
get env(){
return this._env || (this._env = {});
},
scriptName: "",
scheme:"http",
get host(){
Expand Down Expand Up @@ -150,10 +152,9 @@ function Response( response, stream ) {

return;
}

if ( !started ) {
started = true;
response.writeHead( data.status, data.headers );
response.writeHead( data.status || 500, data.headers );
}

try {
Expand Down

0 comments on commit 2d2ad38

Please sign in to comment.