Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Commit

Permalink
Make test request using currently active protocol (#388)
Browse files Browse the repository at this point in the history
For the blob test, make the test request using the active protocol
rather than always using http. At least IE11 will throw an exception
when making an http request from an https domain.

references #387
  • Loading branch information
jason0x43 authored and rorticus committed Apr 19, 2018
1 parent ce88e72 commit 2c57ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/has.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add(
}

const request = new global.XMLHttpRequest();
request.open('GET', 'http://www.google.com', true);
request.open('GET', global.location.protocol + '//www.google.com', true);
request.responseType = 'blob';
request.abort();
return request.responseType === 'blob';
Expand Down

0 comments on commit 2c57ad0

Please sign in to comment.