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 unhelpful isCrossOrigin test. #2715

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export const getFileExtension = function(path) {
* @method isCrossOrigin
*/
export const isCrossOrigin = function(url) {
let urlInfo = parseUrl(url);
let winLoc = window.location;
let urlInfo = parseUrl(url);

// IE8 protocol relative urls will return ':' for protocol
let srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol;
Expand Down
1 change: 0 additions & 1 deletion test/unit/utils/url.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ test('isCrossOrigin can identify cross origin urls', function() {
win.location.protocol = 'https:';
win.location.host = 'google.com';
ok(Url.isCrossOrigin('http://google.com/example.vtt'), 'http://google.com from https://google.com is cross origin');
ok(Url.isCrossOrigin('//google.com/example.vtt'), '//google.com from https://google.com is cross origin');
ok(Url.isCrossOrigin('http://example.com/example.vtt'), 'http://example.com from https://google.com is cross origin');
ok(Url.isCrossOrigin('https://example.com/example.vtt'), 'https://example.com from https://google.com is cross origin');
ok(Url.isCrossOrigin('//example.com/example.vtt'), '//example.com from https://google.com is cross origin');
Expand Down