Skip to content
Myr

update connect to 2.16.1

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent d98e2e7 · Browse files · 6 files+29 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

6 files+29 added−15 removed

  • tests:+3 added−3 removed
  • other:+26 added−12 removed

6 files+29 added−15 removed

modified:lib/router/index.js+7 added-7 removed
1/**2 * Module dependencies.3 */45var Route = require('./route')6 , utils = require('../utils')7 , methods = require('methods')8 , debug = require('debug')('express:router')9 , parse = require('connect').utils.parseUrl;5var Route = require('./route');6var utils = require('../utils');7var methods = require('methods');8var debug = require('debug')('express:router');9var parseUrl = require('parseurl');1011/**12 * Expose `Router` constructor.13 */
167 unmodified lines
181 * @api private182 */183184Router.prototype._options = function(req, res, next){185 var path = parse(req).pathname185 var path = parseUrl(req).pathname186 , body = this._optionsFor(path).join(',');187 if (!body) return next();188 res.set('Allow', body).send(body);189};
31 unmodified lines
221 */222223Router.prototype.matchRequest = function(req, i, head){224 var method = req.method.toLowerCase()225 , url = parse(req)225 , url = parseUrl(req)226 , path = url.pathname227 , routes = this.map228 , i = i || 0229 , route;
92 unmodified lines
modified:lib/request.js+1 added-1 removed
6 unmodified lines
7 , utils = require('./utils')8 , connect = require('connect')9 , fresh = require('fresh')10 , parseRange = require('range-parser')11 , parse = connect.utils.parseUrl11 , parse = require('parseurl')12 , mime = connect.mime;1314/**15 * Request prototype.
520 unmodified lines
modified:lib/response.js+3 added-3 removed
332 unmodified lines
333 done = true;334335 // clean up336 cleanup();337 if (!self.headerSent) self.removeHeader('Content-Disposition');337 if (!self.headersSent) self.removeHeader('Content-Disposition');338339 // callback available340 if (fn) return fn(err);341342 // list in limbo if there's no callback343 if (self.headerSent) return;343 if (self.headersSent) return;344345 // delegate346 next(err);347 }
26 unmodified lines
374 *375 * Optionally providing an alternate attachment `filename`,376 * and optional callback `fn(err)`. The callback is invoked377 * when the data transfer is complete, or when an error has378 * ocurred. Be sure to check `res.headerSent` if you plan to respond.378 * ocurred. Be sure to check `res.headersSent` if you plan to respond.379 *380 * This method uses `res.sendfile()`.381 *382 * @param {String} path
440 unmodified lines
modified:test/res.sendfile.js+3 added-3 removed
40 unmodified lines
4142 app.use(function(req, res){43 res.sendfile('test/fixtures/nope.html', function(err){44 ++calls;45 assert(!res.headerSent);45 assert(!res.headersSent);46 res.send(err.message);47 });48 });49
26 unmodified lines
76 , calls = 0;7778 app.use(function(req, res){79 res.sendfile('test/fixtures/foo/../user.html', function(err){80 assert(!res.headerSent);80 assert(!res.headersSent);81 ++calls;82 res.send(err.message);83 });84 });
9 unmodified lines
94 , calls = 0;9596 app.use(function(req, res){97 res.sendfile('test/fixtures/user.html', function(err){98 assert(!res.headerSent);98 assert(!res.headersSent);99 req.socket.listeners('error').should.have.length(1); // node's original handler100 done();101 });102
140 unmodified lines
modified:History.md+13 added
13.x2===34 * update connect to 2.16.15 - deprecate `res.headerSent` -- use `res.headersSent`6 - deprecate `res.on("header")` -- use on-headers module instead7 - json: use body-parser8 - urlencoded: use body-parser9 - dep: bytes@1.0.010 - dep: cookie-parser@1.1.011 - dep: csurf@1.2.012 - dep: express-session@1.1.013143.6.0 / 2014-05-0915==================1617 * deprecate `app.del()` -- use `app.delete()` instead
1312 unmodified lines
modified:package.json+2 added-1 removed