Skip to content
Myr

Merge tag '3.18.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 · parents cd9d2ec, 88dfd36 · Browse files · 9 files+109 added−49 removed
This commit

State

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

Diff stats

9 files+109 added−49 removed

  • tests:+2 added−2 removed
  • other:+107 added−47 removed

9 files+109 added−49 removed

modified:lib/application.js+6 added-4 removed
2 unmodified lines
3 */45var finalhandler = require('finalhandler');6var flatten = require('./utils').flatten;7var mixin = require('utils-merge');7var Router = require('./router');8var methods = require('methods');9var middleware = require('./middleware/init');10var query = require('./middleware/query');
3 unmodified lines
14var compileETag = require('./utils').compileETag;15var compileQueryParser = require('./utils').compileQueryParser;16var compileTrust = require('./utils').compileTrust;17var deprecate = require('depd')('express');18var merge = require('utils-merge');19var resolve = require('path').resolve;20var slice = Array.prototype.slice;2122/**
464 unmodified lines
487 fn = options, options = {};488 }489490 // merge app.locals491 mixin(opts, this.locals);491 merge(opts, this.locals);492493 // merge options._locals494 if (options._locals) mixin(opts, options._locals);494 if (options._locals) {495 merge(opts, options._locals);496 }497498 // merge options497 mixin(opts, options);499 merge(opts, options);500501 // set .cache unless explicitly provided502 opts.cache = null == opts.cache503 ? this.enabled('view cache')
67 unmodified lines
modified:lib/express.js+1 added-1 removed
modified:lib/response.js+3 added-3 removed
7 unmodified lines
8var http = require('http');9var isAbsolute = require('./utils').isAbsolute;10var onFinished = require('on-finished');11var path = require('path');12var mixin = require('utils-merge');12var merge = require('utils-merge');13var sign = require('cookie-signature').sign;14var normalizeType = require('./utils').normalizeType;15var normalizeTypes = require('./utils').normalizeTypes;16var setCharset = require('./utils').setCharset;
678 unmodified lines
695696res.clearCookie = function(name, options){697 var opts = { expires: new Date(1), path: '/' };698 return this.cookie(name, '', options699 ? mixin(opts, options)699 ? merge(opts, options)700 : opts);701};702703/**
20 unmodified lines
724 * @api public725 */726727res.cookie = function(name, val, options){728 options = mixin({}, options);728 options = merge({}, options);729 var secret = this.req.secret;730 var signed = options.signed;731 if (signed && !secret) throw new Error('cookieParser("secret") required for signed cookies');732 if ('number' == typeof val) val = val.toString();
239 unmodified lines
modified:lib/utils.js+4 added-4 removed
22 unmodified lines
2324exports.etag = function (body, encoding) {25 var buf = !Buffer.isBuffer(body)26 ? new Buffer(body, encoding)27 : body27 : body;2829 return etag(buf, {weak: false})29 return etag(buf, {weak: false});30};3132/**33 * Return weak ETag for `body`.
6 unmodified lines
4041exports.wetag = function wetag(body, encoding){42 var buf = !Buffer.isBuffer(body)43 ? new Buffer(body, encoding)44 : body44 : body;4546 return etag(buf, {weak: true})46 return etag(buf, {weak: true});47};4849/**50 * Check if `path` looks absolute.
233 unmodified lines
modified:test/res.cookie.js+2 added-2 removed
12var express = require('../')3 , request = require('supertest')4 , mixin = require('utils-merge')4 , cookie = require('cookie')5 , cookieParser = require('cookie-parser')6var merge = require('utils-merge');78describe('res', function(){9 describe('.cookie(name, object)', function(){10 it('should generate a JSON cookie', function(done){
101 unmodified lines
112 it('should not mutate the options object', function(done){113 var app = express();114115 var options = { maxAge: 1000 };116 var optionsCopy = mixin({}, options);116 var optionsCopy = merge({}, options);117118 app.use(function(req, res){119 res.cookie('name', 'tobi', options)120 res.end();
53 unmodified lines
modified:.gitignore+24 added-14 removed
1coverage/2.DS_Store3*.seed1# OS X2.DS_Store*3Icon?4._*56# Windows7Thumbs.db8ehthumbs.db9Desktop.ini1011# Linux12.directory13*~141516# npm17node_modules18*.log5*.csv6*.dat7*.out8*.pid9*.swp10*.swo19*.gz202122# Coveralls23coverage2425# Benchmarking26benchmarks/graphs12testing13node_modules/14testing15test.js16.idea
deleted:.npmignore-11 removed
1.git*2benchmarks/3coverage/4docs/5examples/6support/7test/8testing.js9.DS_Store10.travis.yml11Contributing.md
modified:History.md+53 added
3 unmodified lines
4 * Fix `res.send(status)` to mention `res.sendStatus(status)`5 * Use `content-disposition` module for `res.attachment`/`res.download`6 - Sends standards-compliant `Content-Disposition` header7 - Full Unicode support8 * deps: debug@~2.1.09 - Implement `DEBUG_FD` env variable support10 * deps: depd@~1.0.011 * deps: etag@~1.5.012 - Improve string performance13 - Slightly improve speed for weak ETags over 1KB14 * deps: finalhandler@0.3.2
4 unmodified lines
19 * deps: on-finished@~2.1.120 - Fix handling of pipelined requests21 * deps: qs@2.3.022 - Fix parsing of mixed implicit and explicit arrays23 * deps: send@0.10.124 - deps: debug@~2.1.025 - deps: depd@~1.0.026 - deps: etag@~1.5.027 - deps: on-finished@~2.1.128 * deps: serve-static@~1.7.129 - deps: send@0.10.130314.9.8 / 2014-10-17
531 unmodified lines
563 - `app.router()` - returns the app Router instance564 - `app.route()` - Proxy to the app's `Router#route()` method to create a new route565 - Router & Route - public API5665673.18.1 / 2014-10-22568===================569570 * Fix internal `utils.merge` deprecation warnings571 * deps: connect@2.27.1572 - deps: body-parser@~1.9.1573 - deps: express-session@~1.9.1574 - deps: finalhandler@0.3.2575 - deps: morgan@~1.4.1576 - deps: qs@2.3.0577 - deps: serve-static@~1.7.1578 * deps: send@0.10.1579 - deps: on-finished@~2.1.15805813.18.0 / 2014-10-17582===================583584 * Use `content-disposition` module for `res.attachment`/`res.download`585 - Sends standards-compliant `Content-Disposition` header586 - Full Unicode support587 * Use `etag` module to generate `ETag` headers588 * deps: connect@2.27.0589 - Use `http-errors` module for creating errors590 - Use `utils-merge` module for merging objects591 - deps: body-parser@~1.9.0592 - deps: compression@~1.2.0593 - deps: connect-timeout@~1.4.0594 - deps: debug@~2.1.0595 - deps: depd@~1.0.0596 - deps: express-session@~1.9.0597 - deps: finalhandler@0.3.1598 - deps: method-override@~2.3.0599 - deps: morgan@~1.4.0600 - deps: response-time@~2.2.0601 - deps: serve-favicon@~2.1.6602 - deps: serve-index@~1.5.0603 - deps: serve-static@~1.7.0604 * deps: debug@~2.1.0605 - Implement `DEBUG_FD` env variable support606 * deps: depd@~1.0.0607 * deps: send@0.10.0608 - deps: debug@~2.1.0609 - deps: depd@~1.0.0610 - deps: etag@~1.5.06116123.17.8 / 2014-10-15613===================614615 * deps: connect@2.26.6
1816 unmodified lines
modified:package.json+16 added-10 removed
10 unmodified lines
11 "Jonathan Ong <me@jongleberry.com>",12 "Roman Shtylman <shtylman+expressjs@gmail.com>",13 "Young Jae Sim <hanul@hanul.me>"14 ],15 "license": "MIT",16 "repository": "strongloop/express",17 "homepage": "http://expressjs.com/",18 "keywords": [19 "express",20 "framework",21 "sinatra",
3 unmodified lines
25 "router",26 "app",27 "api"28 ],26 "repository": "strongloop/express",27 "license": "MIT",28 "homepage": "http://expressjs.com/",29 "dependencies": {30 "accepts": "~1.1.2",31 "content-disposition": "0.5.0",32 "cookie-signature": "1.0.5",33 "debug": "~2.0.0",34 "depd": "0.4.5",33 "debug": "~2.1.0",34 "depd": "~1.0.0",35 "escape-html": "1.0.1",36 "etag": "~1.5.0",37 "finalhandler": "0.3.2",38 "fresh": "0.2.4",
4 unmodified lines
43 "path-to-regexp": "0.1.3",44 "proxy-addr": "~1.0.3",45 "qs": "2.3.0",46 "range-parser": "~1.0.2",47 "send": "0.9.3",47 "send": "0.10.1",48 "serve-static": "~1.7.1",49 "type-is": "~1.5.2",50 "vary": "~1.0.0",51 "cookie": "0.1.2",
2 unmodified lines
54 },55 "devDependencies": {56 "after": "0.8.1",57 "istanbul": "0.3.2",58 "mocha": "~1.21.5",59 "should": "~4.0.4",58 "mocha": "~2.0.0",59 "should": "~4.1.0",60 "supertest": "~0.14.0",61 "ejs": "~1.0.0",62 "marked": "0.3.2",63 "hjs": "~0.0.6",64 "body-parser": "~1.8.2",65 "connect-redis": "~2.1.0",66 "cookie-parser": "~1.3.3",67 "express-session": "~1.8.2",68 "jade": "~1.6.0",68 "jade": "~1.7.0",69 "method-override": "~2.2.0",70 "morgan": "~1.3.1",71 "multiparty": "~3.3.2",72 "vhost": "~3.0.0"73 },74 "engines": {75 "node": ">= 0.10.0"76 },77 "files": [78 "LICENSE",79 "History.md",80 "Readme.md",81 "index.js",82 "lib/"83 ],84 "scripts": {78 "prepublish": "npm prune",85 "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",86 "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",87 "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/",88 "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/"
2 unmodified lines