Skip to content
Myr

Strict comparisons

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent e0c07d2 · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:lib/express/core.js+1 added-1 removed
267 unmodified lines
268 var self= this;269 request.trigger('request', null, function(error) { 270 if (request.response.finished) return271 try {272 if (typeof (body = (new Router(request)).route()) == 'string')272 if (typeof (body = (new Router(request)).route()) === 'string')273 request.halt(200, body) 274 }275 catch (e) {276 self.error(e, request)
61 unmodified lines
modified:lib/express/request.js+2 added-2 removed
189 unmodified lines
190 respond: function(body, encoding, callback) {191 this.response.body = body192 var self= this;193 this.trigger('response', null, function (error) {194 if (typeof self.response.body != 'string') {callback( new InvalidResponseBody(self) ); return; }195 if (typeof self.response.status != 'number'){ callback( new InvalidStatusCode(self.response.status) ); return; }194 if (typeof self.response.body !== 'string') {callback( new InvalidResponseBody(self) ); return; }195 if (typeof self.response.status !== 'number'){ callback( new InvalidStatusCode(self.response.status) ); return; }196 self.response.writeHeader(self.response.status, self.response.headers)197 self.response.write(self.response.body, encoding)198 self.response.close()199 });
95 unmodified lines