Selaa lähdekoodia

Merge pull request #11529 from GordonSmith/HPCC-20215-IDEScriptIssue

HPCC-20215 ECLWatch script error when using optional "/esp/files/stub…

Reviewed-by: miguelvazq
Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 6 vuotta sitten
vanhempi
commit
f70db3e25d
2 muutettua tiedostoa jossa 8 lisäystä ja 7 poistoa
  1. 1 0
      esp/src/lws.config.js
  2. 7 7
      esp/src/stub.htm

+ 1 - 0
esp/src/lws.config.js

@@ -5,6 +5,7 @@ let rewrite = [
     { from: "/esp/files/Login.html", to: "http://" + debugServerIP + ":8010/esp/files/Login.html" },
     { from: "/esp/files/Login.html", to: "http://" + debugServerIP + ":8010/esp/files/Login.html" },
     { from: "/esp/files/GetUserName.html", to: "http://" + debugServerIP + ":8010/esp/files/GetUserName.html" },
     { from: "/esp/files/GetUserName.html", to: "http://" + debugServerIP + ":8010/esp/files/GetUserName.html" },
     { from: "/esp/login", to: "http://" + debugServerIP + ":8010/esp/login" },
     { from: "/esp/login", to: "http://" + debugServerIP + ":8010/esp/login" },
+    { from: "/esp/getauthtype", to: "http://" + debugServerIP + ":8010/esp/getauthtype" },
     { from: "/esp/files/esp/getauthtype", to: "http://" + debugServerIP + ":8010/esp/getauthtype" },
     { from: "/esp/files/esp/getauthtype", to: "http://" + debugServerIP + ":8010/esp/getauthtype" },
     { from: "/esp/files/esp/lock", to: "http://" + debugServerIP + ":8010/esp/lock" },
     { from: "/esp/files/esp/lock", to: "http://" + debugServerIP + ":8010/esp/lock" },
     { from: "/esp/unlock.json", to: "http://" + debugServerIP + ":8010/esp/unlock.json" },
     { from: "/esp/unlock.json", to: "http://" + debugServerIP + ":8010/esp/unlock.json" },

+ 7 - 7
esp/src/stub.htm

@@ -49,11 +49,9 @@
 
 
             function sendAuthRequest(){
             function sendAuthRequest(){
                 var xhttp = new XMLHttpRequest();
                 var xhttp = new XMLHttpRequest();
-                xhttp.open ('GET', 'esp/getauthtype', true);
-                xhttp.send();
-                xhttp.onload = function(){
-                    var responseType = (this.responseXML.childNodes[0].textContent);
-                    if (this.readyState == 4 && this.status == 200 && this.responseXML.childNodes[0].textContent == responseType){
+                xhttp.onload = function () {
+                    var responseType = this.responseXML && this.responseXML.childNodes && this.responseXML.childNodes.length ? this.responseXML.childNodes[0].textContent : "None";
+                    if (this.readyState == 4 && this.status == 200) {
                         switch (responseType) {
                         switch (responseType) {
                             case 'Mixed':
                             case 'Mixed':
                             case 'PerSessionOnly':
                             case 'PerSessionOnly':
@@ -66,11 +64,13 @@
                                 break;
                                 break;
                             default:
                             default:
                                 document.cookie = ("ESPSessionState=false");
                                 document.cookie = ("ESPSessionState=false");
-                            }
+                        }
                     } else {
                     } else {
-                        alert ('Authorization Request Error.')
+                        alert('Authorization Request Error.')
                     }
                     }
                 }
                 }
+                xhttp.open('GET', '/esp/getauthtype', true);
+                xhttp.send();
             }
             }
         }
         }
     </script>
     </script>