fastify-url
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -24,3 +24,4 @@ "use strict"; | ||
let auth = ''; | ||
if (this.headers.authorization) { | ||
if (this.headers.authorization !== undefined && | ||
this.headers.authorization !== null) { | ||
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#Authorization_and_Proxy-Authorization_headers | ||
@@ -33,3 +34,3 @@ const [type, credentials] = this.headers.authorization.split(' '); | ||
const _url = new url.URL(`${(options && options.protocol) || 'http'}://${auth}${this.headers.host}${this.raw.url}`); | ||
if (key) { | ||
if (key !== undefined && key !== null) { | ||
return _url[key]; | ||
@@ -36,0 +37,0 @@ } |
{ | ||
"name": "fastify-url", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Fastify plugin for parsing and attaching URL data to requests", | ||
@@ -29,3 +29,3 @@ "main": "dist/index.js", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^11.13.0", | ||
"@types/node": "^12.0.0", | ||
"@typescript-eslint/eslint-plugin": "^1.6.0", | ||
@@ -41,3 +41,3 @@ "@typescript-eslint/parser": "^1.6.0", | ||
"mocha": "^6.0.2", | ||
"nyc": "^14.0.0", | ||
"nyc": "^14.1.1", | ||
"prettier": "^1.16.4", | ||
@@ -44,0 +44,0 @@ "ts-node": "^8.0.3", |
Sorry, the diff of this file is not supported yet
159423
72