diff --git a/lib/express/mock-request.js b/lib/express/mock-request.js index 57b28f7..3f08c9a 100644 --- a/lib/express/mock-request.js +++ b/lib/express/mock-request.js @@ -1,7 +1,6 @@ const accepts = require('accepts'); const typeis = require('type-is'); const parseRange = require('range-parser'); -const parse = require('parseurl'); const { isIP } = require('net'); const fresh = require('fresh'); @@ -119,7 +118,7 @@ defineGetter(req, 'subdomains', function subdomains() { }); defineGetter(req, 'path', function path() { - return parse(this).pathname; + return new URL(this).pathname; }); defineGetter(req, 'hostname', function hostname() { diff --git a/package-lock.json b/package-lock.json index b10a9e1..162063b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "merge-descriptors": "^1.0.1", "methods": "^1.1.2", "mime": "^1.3.4", - "parseurl": "^1.3.3", "range-parser": "^1.2.0", "type-is": "^1.6.18" }, @@ -4893,14 +4892,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9948,11 +9939,6 @@ "lines-and-columns": "^1.1.6" } }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", diff --git a/package.json b/package.json index 5484489..9b8a7f6 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "merge-descriptors": "^1.0.1", "methods": "^1.1.2", "mime": "^1.3.4", - "parseurl": "^1.3.3", "range-parser": "^1.2.0", "type-is": "^1.6.18" },