Skip to content

Commit

Permalink
Test for Fix: axios#2670
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroCho committed Jan 16, 2020
1 parent 40c5be3 commit 3a0d3c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/specs/helpers/isValidXss.spec.js
Expand Up @@ -8,10 +8,13 @@ describe('helpers::isValidXss', function () {
expect(isValidXss("<img src='/' onerror='javascript:alert('xss')'>xss</script>")).toBe(true);
expect(isValidXss("<script>console.log('XSS')</script>")).toBe(true);
expect(isValidXss("onerror=alert('XSS')")).toBe(true);
expect(isValidXss("onmouseover=alert('XSS')")).toBe(true);
expect(isValidXss("onkeyup=alert('XSS')")).toBe(true);
expect(isValidXss("<a onclick='alert('XSS')'>Click Me</a>")).toBe(true);
});

it('should not detect non script tags', function() {
expect(isValidXss("only=true")).toBe(false);
expect(isValidXss("/one/?foo=bar")).toBe(false);
expect(isValidXss("<safe> tags")).toBe(false);
expect(isValidXss("<safetag>")).toBe(false);
Expand Down

0 comments on commit 3a0d3c3

Please sign in to comment.