Merge tag '3.10.3'
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 980a15d, 2fd31f6 · Browse files · 3 files·+39 added−53 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+39 added−53 removed
- other:+39 added−53 removed
Provenance
- Commit
9bf1247- Tree
8fe3ea5- Author
Douglas Christopher Wilson <doug@somethingdoug.com>- Committer
Douglas Christopher Wilson <doug@somethingdoug.com>- Parent 1
980a15d- Parent 2
2fd31f6
3 files changed+39 added−53 removed
modified:lib/response.js+4 added-22 removed
16 unmodified lines17 var send = require('send');18 var basename = path.basename;19 var extname = path.extname;20 var mime = send.mime;21+var vary = require('vary');22 23 /**24 * Response prototype.25 */709 unmodified lines735 * @api public736 */737 738 res.vary = function(field){738- var self = this;739-740- // nothing739+ // checks for back-compat740 if (!field) return this;741+ if (Array.isArray(field) && !field.length) return this;742 743- // array744- if (Array.isArray(field)) {745- field.forEach(function(field){746- self.vary(field);747- });748- return;749- }743+ vary(this, field);744 751- var vary = this.get('Vary');752-753- // append754- if (vary) {755- vary = vary.split(/ *, */);756- if (!~vary.indexOf(field)) vary.push(field);757- this.set('Vary', vary.join(', '));758- return this;759- }760-761- // set762- this.set('Vary', field);745 return this;746 };747 748 /**35 unmodified linesmodified:History.md+25 added
1 unreleased2 ==========3 4+ * use `vary` module for `res.vary`5 * deps: proxy-addr@1.0.16 * deps: type-is@1.2.17+ * deps: debug@1.0.08 9 4.4.1 / 2014-06-0210 ==================11 150 unmodified lines162 - `app.router()` - returns the app Router instance163 - `app.route()` - Proxy to the app's `Router#route()` method to create a new route164 - Router & Route - public API165 166+3.10.3 / 2014-06-05167+===================168+169+ * use `vary` module for `res.vary`170+ * deps: connect@2.19.4171+ - deps: errorhandler@1.0.2172+ - deps: method-override@2.0.2173+ - deps: serve-favicon@2.0.1174+ * deps: debug@1.0.0175+176+3.10.2 / 2014-06-03177+===================178+179+ * deps: connect@2.19.3180+ - deps: compression@1.0.6181+182+3.10.1 / 2014-06-03183+===================184+185+ * deps: connect@2.19.2186+ - deps: compression@1.0.4187+ * deps: proxy-addr@1.0.1188+189 3.10.0 / 2014-06-02190 ===================191 192 * deps: connect@2.19.11388 unmodified linesmodified:package.json+10 added-31 removed
2 unmodified lines345678910111213141516171819202122232425262728293031323334789101112131415164 unmodified lines21222324472526272829303132333435363738394041424344456667464748495026 unmodified lines2 unmodified lines "description": "Sinatra inspired web development framework", "version": "4.4.1", "author": "TJ Holowaychuk <tj@vision-media.ca>", "contributors": [ { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, { "name": "Aaron Heckmann", "email": "aaron.heckmann+github@gmail.com" }, { "name": "Ciaran Jessup", "email": "ciaranj@gmail.com" }, { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" }, { "name": "Guillermo Rauch", "email": "rauchg@gmail.com" }, { "name": "Jonathan Ong", "email": "me@jongleberry.com" }, { "name": "Roman Shtylman", "email": "shtylman+expressjs@gmail.com" } "Aaron Heckmann <aaron.heckmann+github@gmail.com>", "Ciaran Jessup <ciaranj@gmail.com>", "Douglas Christopher Wilson <doug@somethingdoug.com>", "Guillermo Rauch <rauchg@gmail.com>", "Jonathan Ong <me@jongleberry.com>", "Roman Shtylman <shtylman+expressjs@gmail.com" ], "keywords": [ "express", "framework",4 unmodified lines "router", "app", "api" ], "repository": "git://github.com/visionmedia/express", "repository": "visionmedia/express", "license": "MIT", "dependencies": { "accepts": "1.0.2", "buffer-crc32": "0.2.1", "debug": "1.0.0", "escape-html": "1.0.1", "methods": "1.0.1", "parseurl": "1.0.1", "proxy-addr": "1.0.1", "range-parser": "1.0.0", "send": "0.4.1", "serve-static": "1.2.1", "type-is": "1.2.1", "vary": "0.1.0", "cookie": "0.1.2", "fresh": "0.2.2", "cookie-signature": "1.0.3", "merge-descriptors": "0.0.2", "utils-merge": "1.0.0", "qs": "0.6.6", "path-to-regexp": "0.1.2", "debug": "0.8.1" "path-to-regexp": "0.1.2" }, "devDependencies": { "after": "0.8.1", "istanbul": "0.2.10",26 unmodified lines