2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00

Remove unnecessary XSS check introduced by #2451 (#2679)

* Remove unnecessary XSS check introduced by #2451

* Remove test file of `isValidXss`
This commit is contained in:
Xianming Zhong
2020-01-21 00:20:33 +08:00
committed by Emily Morehouse
parent 351cf290f0
commit c7488c7dd5
4 changed files with 0 additions and 43 deletions
-5
View File
@@ -1,7 +1,6 @@
'use strict';
var utils = require('./../utils');
var isValidXss = require('./isValidXss');
module.exports = (
utils.isStandardBrowserEnv() ?
@@ -22,10 +21,6 @@ module.exports = (
function resolveURL(url) {
var href = url;
if (isValidXss(url)) {
throw new Error('URL contains XSS injection attempt');
}
if (msie) {
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
-7
View File
@@ -1,7 +0,0 @@
'use strict';
module.exports = function isValidXss(requestURL) {
var xssRegex = /(\b)(on\w+)=|javascript|(<\s*)(\/*)script/gi;
return xssRegex.test(requestURL);
};