Skip to content
Myr

Inverted plugin async support. Return true WHEN async

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

authored by visionmedia · committed by visionmedia · parent 9e99673 · Browse files · 11 files+1 added−15 removed
This commit

State

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

Diff stats

11 files+1 added−15 removed

  • other:+1 added−15 removed

11 files+1 added−15 removed

modified:lib/express/plugins/body-decoder.js-1 removed
modified:lib/express/plugins/common-logger.js-1 removed
modified:lib/express/plugins/content-length.js-1 removed
modified:lib/express/plugins/cookie.js-2 removed
94 unmodified lines
95 event.request.response.cookies = []96 event.request.cookies = event.request.headers.cookie97 ? exports.parseCookie(event.request.headers.cookie)98 : {}99 return true;99 },100 101 /**102 * Set the Set-Cookie header when response cookies are available.
1 unmodified line
104 105 response: function(event) {106 if (event.response.cookies.length)107 event.request.header('set-cookie', event.response.cookies.join(', '))109 return true;108 }109 }110})
modified:lib/express/plugins/hooks.js-2 removed
modified:lib/express/plugins/method-override.js-1 removed
modified:lib/express/plugins/profiler.js-2 removed
30 unmodified lines
31 */32 33 request: function(event) {34 this.start = Number(new Date)35 return true;35 },36 37 /**38 * Output duration.
6 unmodified lines
45 puts(event.request.method + ' ' + 46 event.request.url.pathname + ': ' + 47 (Number(new Date) - this.start) + ' ms' +48 ' #' + ++n)50 return true;49 }50 }51})
modified:lib/express/plugins/redirect.js-1 removed
50 unmodified lines
51 52 request: function(event) {53 event.request.home = set('home') || set('basepath') || '/'54 event.request.back = event.request.header('referrer') || event.request.header('referer')55 return true;55 }56 }57})
modified:lib/express/plugins/session.js-2 removed
189 unmodified lines
190 if (!(sid = event.request.cookie('sid')))191 event.request.cookie('sid', sid = utils.uid(), set('session cookie'))192 event.request.session = exports.Session.store.fetch(sid)193 event.request.session.touch()194 return true;194 },195 196 /**197 * Delegate to store, allowing it to save sessions changes.198 */199 200 response: function(event) {201 exports.Session.store.commit(event.request.session)203 return true;202 }203 }204})
modified:lib/express/plugin.js-1 removed
55 unmodified lines
56 trigger: function(event, callback) {57 if ('on' in this)58 if (event.name in this.on)59 return this.on[event.name].call(this, event, callback)60 return true;60 }61})
modified:lib/express/request.js+1 added-1 removed
215 unmodified lines
216 if (e || complete === total)217 callback(e)218 else {219 try {220 if (self.plugins.at(complete++).trigger(new Event(name, data), next) === true)220 if (self.plugins.at(complete++).trigger(new Event(name, data), next) !== true)221 next()222 } catch(e) {223 next(e)224 }
47 unmodified lines