Skip to content

Commit

Permalink
Merge pull request #11529 from GordonSmith/HPCC-20215-IDEScriptIssue
Browse files Browse the repository at this point in the history
HPCC-20215 ECLWatch script error when using optional "/esp/files/stub…

Reviewed-by: miguelvazq
Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday committed Aug 8, 2018
2 parents afc4312 + 3790594 commit f70db3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions esp/src/lws.config.js
Expand Up @@ -5,6 +5,7 @@ let rewrite = [
{ 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/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/lock", to: "http://" + debugServerIP + ":8010/esp/lock" },
{ from: "/esp/unlock.json", to: "http://" + debugServerIP + ":8010/esp/unlock.json" },
Expand Down
14 changes: 7 additions & 7 deletions esp/src/stub.htm
Expand Up @@ -49,11 +49,9 @@

function sendAuthRequest(){
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) {
case 'Mixed':
case 'PerSessionOnly':
Expand All @@ -66,11 +64,13 @@
break;
default:
document.cookie = ("ESPSessionState=false");
}
}
} else {
alert ('Authorization Request Error.')
alert('Authorization Request Error.')
}
}
xhttp.open('GET', '/esp/getauthtype', true);
xhttp.send();
}
}
</script>
Expand Down

0 comments on commit f70db3e

Please sign in to comment.