Fixed whitespace from another devs commits
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 44f1a5d · Browse files · 2 files·+33 added−36 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+33 added−36 removed
- tests:+22 added−23 removed
- other:+11 added−13 removed
Provenance
- Commit
f623873- Tree
ab771f5- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
44f1a5d
2 files changed+33 added−36 removed
modified:lib/express.core.js+11 added-13 removed
248 unmodified lines249 Express.home = Express.settings.basepath250 Express.response.body = null251 Express.response.status = 200252 Express.request = request253- Express.originalResponse = response253+ Express.originalResponse = response254 request.headers = Express.arrayToHash(request.headers)255 request.uri.params = Express.parseNestedParams(request.uri.params)256 request.uri.path = Express.normalizePath(request.uri.path)257 Express.hook('onRequest')258 try { Express.response.body = Express.callRouteFor(request) }259 catch (e) { Express.fail(e) }260- 261- if (Express.response.body) {262- Express.server.finished()263- }260+ if (Express.response.body) {261+ Express.server.finished()262+ }263 })264 },265 267- finished: function(body) {268- if (body) Express.response.body = body269- Express.hook('onResponse')270- Express.originalResponse.sendHeader(Express.response.status, Express.hashToArray(Express.response.headers))271- Express.originalResponse.sendBody(Express.response.body || '')272- Express.originalResponse.finish()273- }274- 266+ finished: function(body) {267+ if (body) Express.response.body = body268+ Express.hook('onResponse')269+ Express.originalResponse.sendHeader(Express.response.status, Express.hashToArray(Express.response.headers))270+ Express.originalResponse.sendBody(Express.response.body || '')271+ Express.originalResponse.finish()272+ }273 },274 275 /**276 * Fail Express with exception _e_.452 unmodified linesmodified:spec/spec.async.js+22 added-23 removed
3 unmodified lines4567891011121314151617181920212223242526272829308910111213141516171819202122232425262728293031323 unmodified lines before_each Express.routes = [] end
describe 'callback' it 'should wait for an asynchronous handler to finish' require('jspec.timers') get('pants', function() { setTimeout(function() { Express.server.finished('asynchronous thing done') }, 50) }) var response = get('pants') response.body.should.be_null
tick(50) response.body.should.eql 'asynchronous thing done' response.status.should.eql 200 response.headers['content-type'].should.eql 'text/html' end it 'should still accept a synchronous handler that returns a string' get('pants', function() { 'no pants' }) get('pants').body.should.eql 'no pants' end end describe 'callback' it 'should wait for an asynchronous handler to finish' require('jspec.timers') get('pants', function() { setTimeout(function() { Express.server.finished('asynchronous thing done') }, 50) }) var response = get('pants') response.body.should.be_null tick(50) response.body.should.eql 'asynchronous thing done' response.status.should.eql 200 response.headers['content-type'].should.eql 'text/html' end it 'should still accept a synchronous handler that returns a string' get('pants', function() { 'no pants' }) get('pants').body.should.eql 'no pants' end end endend