diff options
author | Kat Marchán <kzm@zkat.tech> | 2018-07-18 13:55:52 -0700 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-07-29 14:16:56 +0200 |
commit | 5842366ae83a36065d626e3937ad8fc327efab30 (patch) | |
tree | 663eb6d493b00788d83d7a71fc2489adabd24527 /deps/npm/node_modules/hawk/lib/utils.js | |
parent | 2aca0957f46af0be33368a1fcb398e63a35c46ef (diff) | |
download | android-node-v8-5842366ae83a36065d626e3937ad8fc327efab30.tar.gz android-node-v8-5842366ae83a36065d626e3937ad8fc327efab30.tar.bz2 android-node-v8-5842366ae83a36065d626e3937ad8fc327efab30.zip |
deps: upgrade npm to 6.2.0
PR-URL: https://github.com/nodejs/node/pull/21592
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/hawk/lib/utils.js')
-rwxr-xr-x | deps/npm/node_modules/hawk/lib/utils.js | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/deps/npm/node_modules/hawk/lib/utils.js b/deps/npm/node_modules/hawk/lib/utils.js index 565b1c7a7b..2da3343904 100755 --- a/deps/npm/node_modules/hawk/lib/utils.js +++ b/deps/npm/node_modules/hawk/lib/utils.js @@ -1,14 +1,12 @@ -'use strict'; - // Load modules -const Sntp = require('sntp'); -const Boom = require('boom'); +var Sntp = require('sntp'); +var Boom = require('boom'); // Declare internals -const internals = {}; +var internals = {}; exports.version = function () { @@ -31,7 +29,7 @@ internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+ exports.parseHost = function (req, hostHeaderName) { hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host'); - const hostHeader = req.headers[hostHeaderName]; + var hostHeader = req.headers[hostHeaderName]; if (!hostHeader) { return null; } @@ -40,7 +38,7 @@ exports.parseHost = function (req, hostHeaderName) { return null; } - const hostParts = hostHeader.match(internals.hostHeaderRegex); + var hostParts = hostHeader.match(internals.hostHeaderRegex); if (!hostParts) { return null; } @@ -74,7 +72,7 @@ exports.parseRequest = function (req, options) { // Obtain host and port information - let host; + var host; if (!options.host || !options.port) { @@ -84,7 +82,7 @@ exports.parseRequest = function (req, options) { } } - const request = { + var request = { method: req.method, url: req.url, host: options.host || host.name, @@ -127,24 +125,24 @@ exports.parseAuthorizationHeader = function (header, keys) { return Boom.badRequest('Header length too long'); } - const headerParts = header.match(internals.authHeaderRegex); + var headerParts = header.match(internals.authHeaderRegex); if (!headerParts) { return Boom.badRequest('Invalid header syntax'); } - const scheme = headerParts[1]; + var scheme = headerParts[1]; if (scheme.toLowerCase() !== 'hawk') { return Boom.unauthorized(null, 'Hawk'); } - const attributesString = headerParts[2]; + var attributesString = headerParts[2]; if (!attributesString) { return Boom.badRequest('Invalid header syntax'); } - const attributes = {}; - let errorMessage = ''; - const verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, ($0, $1, $2) => { + var attributes = {}; + var errorMessage = ''; + var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) { // Check valid attribute names @@ -181,5 +179,5 @@ exports.parseAuthorizationHeader = function (header, keys) { exports.unauthorized = function (message, attributes) { - return Boom.unauthorized(message || null, 'Hawk', attributes); + return Boom.unauthorized(message, 'Hawk', attributes); }; |