diff --git a/README.md b/README.md index dd4b45ef..b232743e 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you want to automatically enable cross-domain requests when needed, use the f ```javascript (function() { var cors_api_host = 'cors-anywhere.herokuapp.com'; - var cors_api_url = (window.location.protocol === 'http:' ? 'http://' : 'https://') + cors_api_host + '/'; + var cors_api_url = 'https://' + cors_api_host + '/'; var slice = [].slice; var origin = window.location.protocol + '//' + window.location.host; var open = XMLHttpRequest.prototype.open; @@ -74,8 +74,7 @@ If you're using jQuery, you can also use the following code **instead of** the p ```javascript jQuery.ajaxPrefilter(function(options) { if (options.crossDomain && jQuery.support.cors) { - options.url = (window.location.protocol === 'http:' ? 'http:' : 'https:') + - '//cors-anywhere.herokuapp.com/' + options.url; + options.url = 'https://cors-anywhere.herokuapp.com/' + options.url; } }); ``` diff --git a/demo.html b/demo.html index 6307dcf0..185c67a7 100644 --- a/demo.html +++ b/demo.html @@ -64,8 +64,7 @@