File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -909,6 +909,7 @@ Raven.prototype = {
909909 _makeXhrRequest : function ( opts ) {
910910 var request ;
911911
912+ var url = opts . url ;
912913 function handler ( ) {
913914 if ( request . status === 200 ) {
914915 if ( opts . onSuccess ) {
@@ -929,13 +930,17 @@ Raven.prototype = {
929930 } ;
930931 } else {
931932 request = new XDomainRequest ( ) ;
933+ // xdomainrequest cannot go http -> https (or vice versa),
934+ // so always use protocol relative
935+ url = url . replace ( / ^ h t t p s ? : / , '' ) ;
936+
932937 // onreadystatechange not supported by XDomainRequest
933938 request . onload = handler ;
934939 }
935940
936941 // NOTE: auth is intentionally sent as part of query string (NOT as custom
937942 // HTTP header) so as to avoid preflight CORS requests
938- request . open ( 'POST' , opts . url + '?' + urlencode ( opts . auth ) ) ;
943+ request . open ( 'POST' , url + '?' + urlencode ( opts . auth ) ) ;
939944 request . send ( JSON . stringify ( opts . data ) ) ;
940945 } ,
941946
You can’t perform that action at this time.
0 commit comments