2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00
Files
axios/test/specs/helpers/isURLSameOrigin.spec.js
T
Wataru 19969b4fbd Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… (#2451)
* Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scripting

* use var insted of const
2019-10-08 21:23:34 -03:00

16 lines
539 B
JavaScript

var isURLSameOrigin = require('../../../lib/helpers/isURLSameOrigin');
describe('helpers::isURLSameOrigin', function () {
it('should detect same origin', function () {
expect(isURLSameOrigin(window.location.href)).toEqual(true);
});
it('should detect different origin', function () {
expect(isURLSameOrigin('https://github.com/axios/axios')).toEqual(false);
});
it('should detect xss', function () {
expect(isURLSameOrigin('https://github.com/axios/axios?<script>alert("hello")</script>')).toEqual(false)
})
});