Removed anonymous func for scoping
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent e6f71f9 · Browse files · 2 files·+40 added−44 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+40 added−44 removed
- other:+40 added−44 removed
Provenance
- Commit
50cb104- Tree
1d7d984- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
e6f71f9
2 files changed+40 added−44 removed
modified:lib/express.cookie.js+39 added-43 removed
1234456677891011129101112131415161718192021222313141516171819202122252627282930313233343536373839404142434445464723242526274928293031323334353637383940414243444546475248
// Express - Cookie - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
(function(){Express.Cookie = { name : 'cookie', Express.Cookie = { name : 'cookie', settings : { maxAge : 3600 }, utilities : { settings : { maxAge : 3600 }, utilities : { /** * Return cookie _key_. When _value_ is present * then a response cookie field will be set. * * @param {string} key * @param {string} value * @return {string, hash} * @api public */ /** * Return cookie _key_. When _value_ is present * then a response cookie field will be set. * * @param {string} key * @param {string} value * @return {string, hash} * @api public */
cookie : function(key, value) { return value ? Express.response.cookie[key] = value : Express.response.cookie[key] } }, onRequest : { 'parse cookie' : function() { Express.response.cookie = Express.request.cookie = Express.parseCookie(Express.requestHeader('Cookie')); } }, onResponse : { 'set cookie' : function() { var cookie = [] for (var key in Express.response.cookie) if (Express.response.cookie.hasOwnProperty(key)) cookie.push(key + '=' + Express.response.cookie[key]) if (cookie.length) Express.header('Set-Cookie', cookie.join('; ')) } cookie : function(key, value) { return value ? Express.response.cookie[key] = value : Express.response.cookie[key] } }, onRequest : { 'parse cookie' : function() { Express.response.cookie = Express.request.cookie = Express.parseCookie(Express.requestHeader('Cookie')); } }, onResponse : { 'set cookie' : function() { var cookie = [] for (var key in Express.response.cookie) if (Express.response.cookie.hasOwnProperty(key)) cookie.push(key + '=' + Express.response.cookie[key]) if (cookie.length) Express.header('Set-Cookie', cookie.join('; ')) } } })()No newline at end of file}modified:lib/express.core.js+1 added-1 removed
711 unmodified lines712 }713 }714 }715 716-// --- Expose716+// --- Routing API717 718 get = Express.routeFunctionFor('get')719 post = Express.routeFunctionFor('post')720 del = Express.routeFunctionFor('delete')11 unmodified lines