made secure logic smarter
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 14 Aug 2006 21:16:25 +0000 (21:16 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 14 Aug 2006 21:16:25 +0000 (21:16 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5503 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/RemoteRequest.js

index ee5a869..e9d4b25 100644 (file)
@@ -222,11 +222,14 @@ RemoteRequest.prototype.send = function(blocking) {
        var url = location.protocol + "//" + location.host + "/" + XML_HTTP_GATEWAY;
 
        if(isXUL()) {
-               netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
                if( XML_HTTP_SERVER ) 
                        url = 'http://'+XML_HTTP_SERVER+'/'+XML_HTTP_GATEWAY;
-               if( this.secure ) url = url.replace(/http:/, 'https:');
-               else url = url.replace(/https/, 'http');
+
+               if( url.match(/^http:/) && 
+                               (this.secure || location.href.match(/^https:/)) ) {
+                       netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+                       url = url.replace(/^http:/, 'https:');
+               }
        }
 
        var data = null;