Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
fix for window.location.protocol checks (moved err to iframe page)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecaroth committed Oct 26, 2016
1 parent 959a6e9 commit db81273
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 0 additions & 4 deletions dev/xdomain_cookie.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
_secure_only = !!secure_only, //should cookies be written as HTTPS-only cookies
_debug = !!debug;

if(_secure_only && window.window.location.protocol !== 'https:'){
return console.error("xDomainCookie - ERROR, secure_only flag set but page is not loaded over HTTPS:");
}

function _log(){
if(!_debug) return;
arguments[0] = ":XDC_PAGE: "+arguments[0];
Expand Down
4 changes: 4 additions & 0 deletions dev/xdomain_cookie.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
if(!('msg_type' in data) || data.msg_type !== 'xdsc_write') return; //data is not a xdomainc-cookie payload
if(!('namespace' in data) || data.namespace !== _namespace) return; //wrong namespace for msg

if(data.secure_only && window.location.protocol !== 'https:'){
console.error("xDomainCookie - ERROR, secure_only flag set but page is not loaded over HTTPS:");
}

var expires_days = parseInt(data.expires_days,10);
_set_local_cookie( data.cookie_name, data.cookie_val, expires_days, data.secure_only );
//ping down to page again to update values of xdomain cookie data
Expand Down
4 changes: 4 additions & 0 deletions src/xdomain_cookie.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
if(!('msg_type' in data) || data.msg_type !== 'xdsc_write') return; //data is not a xdomainc-cookie payload
if(!('namespace' in data) || data.namespace !== _namespace) return; //wrong namespace for msg

if(data.secure_only && window.location.protocol !== 'https:'){
console.error("xDomainCookie - ERROR, secure_only flag set but page is not loaded over HTTPS:");
}

var expires_days = parseInt(data.expires_days,10);
_set_local_cookie( data.cookie_name, data.cookie_val, expires_days, data.secure_only );
//ping down to page again to update values of xdomain cookie data
Expand Down
4 changes: 0 additions & 4 deletions src/xdomain_cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
_secure_only = !!secure_only, //should cookies be written as HTTPS-only cookies
_debug = !!debug;

if(_secure_only && window.window.location.protocol !== 'https:'){
return console.error("xDomainCookie - ERROR, secure_only flag set but page is not loaded over HTTPS:");
}

function _log(){
if(!_debug) return;
arguments[0] = ":XDC_PAGE: "+arguments[0];
Expand Down
2 changes: 1 addition & 1 deletion src/xdomain_cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db81273

Please sign in to comment.