Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary XSS check introduced by #2451 #2679

Merged
merged 2 commits into from Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.