Skip to content

Commit c7488c7

Browse files
chinesedfanemilyemorehouse
authored andcommitted
Remove unnecessary XSS check introduced by #2451 (#2679)
* Remove unnecessary XSS check introduced by #2451 * Remove test file of `isValidXss`
1 parent 351cf29 commit c7488c7

File tree

4 files changed

+0
-43
lines changed

4 files changed

+0
-43
lines changed

lib/helpers/isURLSameOrigin.js

-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
var utils = require('./../utils');
4-
var isValidXss = require('./isValidXss');
54

65
module.exports = (
76
utils.isStandardBrowserEnv() ?
@@ -22,10 +21,6 @@ module.exports = (
2221
function resolveURL(url) {
2322
var href = url;
2423

25-
if (isValidXss(url)) {
26-
throw new Error('URL contains XSS injection attempt');
27-
}
28-
2924
if (msie) {
3025
// IE needs attribute set twice to normalize properties
3126
urlParsingNode.setAttribute('href', href);

lib/helpers/isValidXss.js

-7
This file was deleted.

test/specs/helpers/isURLSameOrigin.spec.js

-6
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,4 @@ describe('helpers::isURLSameOrigin', function () {
88
it('should detect different origin', function () {
99
expect(isURLSameOrigin('https://github.com/axios/axios')).toEqual(false);
1010
});
11-
12-
it('should detect XSS scripts on a same origin request', function () {
13-
expect(function() {
14-
isURLSameOrigin('https://github.com/axios/axios?<script>alert("hello")</script>');
15-
}).toThrowError(Error, 'URL contains XSS injection attempt')
16-
});
1711
});

test/specs/helpers/isValidXss.spec.js

-25
This file was deleted.

0 commit comments

Comments
 (0)