Skip to content

Commit

Permalink
Remove unnecessary XSS check introduced by #2451 (#2679)
Browse files Browse the repository at this point in the history
* Remove unnecessary XSS check introduced by #2451

* Remove test file of `isValidXss`
  • Loading branch information
chinesedfan authored and emilyemorehouse committed Jan 20, 2020
1 parent 351cf29 commit c7488c7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
5 changes: 0 additions & 5 deletions lib/helpers/isURLSameOrigin.js
@@ -1,7 +1,6 @@
'use strict';

var utils = require('./../utils');
var isValidXss = require('./isValidXss');

module.exports = (
utils.isStandardBrowserEnv() ?
Expand All @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions lib/helpers/isValidXss.js

This file was deleted.

6 changes: 0 additions & 6 deletions test/specs/helpers/isURLSameOrigin.spec.js
Expand Up @@ -8,10 +8,4 @@ describe('helpers::isURLSameOrigin', function () {
it('should detect different origin', function () {
expect(isURLSameOrigin('https://github.com/axios/axios')).toEqual(false);
});

it('should detect XSS scripts on a same origin request', function () {
expect(function() {
isURLSameOrigin('https://github.com/axios/axios?<script>alert("hello")</script>');
}).toThrowError(Error, 'URL contains XSS injection attempt')
});
});
25 changes: 0 additions & 25 deletions test/specs/helpers/isValidXss.spec.js

This file was deleted.

0 comments on commit c7488c7

Please sign in to comment.