Skip to content
Myr

removed "root" setting

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

screw it, no one will understand anyway

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 5d593f2 · Browse files · 5 files+22 added−40 removed
This commit

State

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

Diff stats

5 files+22 added−40 removed

  • tests:+17 added−27 removed
  • other:+5 added−13 removed

5 files+22 added−40 removed

modified:lib/application.js+1 added-7 removed
77 unmodified lines
78app.defaultConfiguration = function(){79 var self = this;8081 // default settings82 this.set('root', '/');82 this.set('env', process.env.NODE_ENV || 'development');8384 // implicit middleware85 this.use(connect.query());
103 unmodified lines
189 }190191 connect.proto.use.call(this, route, fn);192194 // mounted an app, emit "mount"195 // and adjust some settings193 // mounted an app194 if (app) {197 var root = this.get('root') || this.route;198 if ('/' == root) root = '';199 root = root + (app.get('root') || app.route);200 app.set('root', root);195 app.parent = this;196 app.emit('mount', this);197 }198
358 unmodified lines
modified:lib/response.js+4 added-6 removed
360 unmodified lines
361 * @api public362 */363364res.clearCookie = function(name, options){365 var opts = { expires: new Date(1), path: this.app.get('root') };365 var opts = { expires: new Date(1), path: '/' };366 return this.cookie(name, '', options367 ? utils.merge(opts, options)368 : opts);369};
21 unmodified lines
391 *392 * Options:393 *394 * - `maxAge` max-age in milliseconds, converted to `expires`395 * - `path` defaults to the "root" setting which is typically "/"395 * - `path` defaults to "/"396 *397 * Examples:398 *399 * // "Remember Me" for 15 minutes
11 unmodified lines
411res.cookie = function(name, val, options){412 options = options || {};413 if ('object' == typeof val) val = 'j:' + JSON.stringify(val);414 if ('maxAge' in options) options.expires = new Date(Date.now() + options.maxAge);415 if (undefined === options.path) options.path = this.app.set('root');415 if (undefined === options.path) options.path = '/';416 var cookie = utils.serializeCookie(name, val, options);417 this.header('Set-Cookie', cookie);418 return this;419};
3 unmodified lines
423 * defaulting to 302.424 *425 * The given `url` can also be the name of a mapped url, for426 * example by default express supports "back" which redirects427 * to the _Referrer_ or _Referer_ headers or the application's428 * "root" setting. Express also supports "root" out of the box,429 * which can be set via `app.set('root', '/blog');`.427 * to the _Referrer_ or _Referer_ headers or "/".428 *429 * Examples:430 *431 * res.redirect('/foo/bar');
165 unmodified lines
modified:test/app.locals.js-1 removed
modified:test/app.use.js-9 removed
modified:test/res.clearCookie.js+17 added-17 removed