Skip to content

Commit

Permalink
Update isAbsoluteURL.js (axios#3809)
Browse files Browse the repository at this point in the history
Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect, as demonstrated in the following example:

https://eslint.org/docs/rules/no-useless-escape

Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
lzxb and jasonsaayman committed Dec 23, 2021
1 parent 03f0031 commit 8590313
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/helpers/isAbsoluteURL.js
Expand Up @@ -10,5 +10,5 @@ module.exports = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
};

0 comments on commit 8590313

Please sign in to comment.