Skip to content

Commit

Permalink
do not harden in case that helps
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Dec 26, 2022
1 parent 2475de3 commit 0008c09
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const {
SymbolIterator,
SymbolToStringTag,
decodeURIComponent,
hardenRegExp,
} = primordials;

const { inspect } = require('internal/util/inspect');
Expand Down Expand Up @@ -117,7 +116,7 @@ const {
revokeDataObject,
} = internalBinding('blob');

const FORWARD_SLASH = hardenRegExp(/\//g);
const FORWARD_SLASH = (/\//g;

const context = Symbol('context');
const cannotBeBase = Symbol('cannot-be-base');
Expand Down Expand Up @@ -1505,11 +1504,11 @@ function fileURLToPath(path) {
// - CR: The carriage return character is also stripped out by the `pathname`
// setter.
// - TAB: The tab character is also stripped out by the `pathname` setter.
const percentRegEx = hardenRegExp(/%/g);
const backslashRegEx = hardenRegExp(/\\/g);
const newlineRegEx = hardenRegExp(/\n/g);
const carriageReturnRegEx = hardenRegExp(/\r/g);
const tabRegEx = hardenRegExp(/\t/g);
const percentRegEx = (/%/g;
const backslashRegEx = (/\\/g;
const newlineRegEx = (/\n/g;
const carriageReturnRegEx = (/\r/g;
const tabRegEx = (/\t/g;

function encodePathChars(filepath) {
if (StringPrototypeIncludes(filepath, '%'))
Expand Down

0 comments on commit 0008c09

Please sign in to comment.