updated npm modules
This commit is contained in:
2
node_modules/express/lib/express.js
generated
vendored
2
node_modules/express/lib/express.js
generated
vendored
@@ -77,7 +77,9 @@ exports.Router = Router;
|
||||
|
||||
exports.json = bodyParser.json
|
||||
exports.query = require('./middleware/query');
|
||||
exports.raw = bodyParser.raw
|
||||
exports.static = require('serve-static');
|
||||
exports.text = bodyParser.text
|
||||
exports.urlencoded = bodyParser.urlencoded
|
||||
|
||||
/**
|
||||
|
||||
4
node_modules/express/lib/request.js
generated
vendored
4
node_modules/express/lib/request.js
generated
vendored
@@ -430,6 +430,10 @@ defineGetter(req, 'hostname', function hostname(){
|
||||
|
||||
if (!host || !trust(this.connection.remoteAddress, 0)) {
|
||||
host = this.get('Host');
|
||||
} else if (host.indexOf(',') !== -1) {
|
||||
// Note: X-Forwarded-Host is normally only ever a
|
||||
// single value, but this is to be safe.
|
||||
host = host.substring(0, host.indexOf(',')).trimRight()
|
||||
}
|
||||
|
||||
if (!host) return;
|
||||
|
||||
11
node_modules/express/lib/response.js
generated
vendored
11
node_modules/express/lib/response.js
generated
vendored
@@ -64,6 +64,10 @@ var charsetRegExp = /;\s*charset\s*=/;
|
||||
*/
|
||||
|
||||
res.status = function status(code) {
|
||||
if (code === undefined || code === null) {
|
||||
throw new TypeError('code argument is required to res.status')
|
||||
}
|
||||
|
||||
this.statusCode = code;
|
||||
return this;
|
||||
};
|
||||
@@ -411,6 +415,10 @@ res.sendFile = function sendFile(path, options, callback) {
|
||||
throw new TypeError('path argument is required to res.sendFile');
|
||||
}
|
||||
|
||||
if (typeof path !== 'string') {
|
||||
throw new TypeError('path must be a string to res.sendFile')
|
||||
}
|
||||
|
||||
// support function as second arg
|
||||
if (typeof options === 'function') {
|
||||
done = options;
|
||||
@@ -814,7 +822,7 @@ res.clearCookie = function clearCookie(name, options) {
|
||||
* // "Remember Me" for 15 minutes
|
||||
* res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });
|
||||
*
|
||||
* // save as above
|
||||
* // same as above
|
||||
* res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })
|
||||
*
|
||||
* @param {String} name
|
||||
@@ -1127,6 +1135,7 @@ function stringify (value, replacer, spaces, escape) {
|
||||
return '\\u003e'
|
||||
case 0x26:
|
||||
return '\\u0026'
|
||||
/* istanbul ignore next: unreachable default */
|
||||
default:
|
||||
return c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user