The location.host includes the port number in the URL, if specified; the hostname does not.
The reordering of calls makes it easier to tell whether the crash is happening during a 200/Success or 401/Unauthorized response.
GSSWeb.prototype.authGetServerName = function () {
this.gss.import_name({
GSSWeb.prototype.authGetServerName = function () {
this.gss.import_name({
- name: "HTTP@" + window.location.host,
+ name: "HTTP@" + window.location.hostname,
success: this.authReceiveServerName.bind(this)
});
};
success: this.authReceiveServerName.bind(this)
});
};
- var serverResponse = JSON.parse(this.xhr.responseText);
- this.serverToken = serverResponse.gssweb.token;
switch (this.xhr.status) {
case 200:
// Finished!
switch (this.xhr.status) {
case 200:
// Finished!
+ var serverResponse = JSON.parse(this.xhr.responseText);
var decoded = window.atob(serverResponse.application.data);
this.authenticationState = true;
this.success(
var decoded = window.atob(serverResponse.application.data);
this.authenticationState = true;
this.success(
break;
case 401:
// Continue needed
break;
case 401:
// Continue needed
+ var serverResponse = JSON.parse(this.xhr.responseText);
+ this.serverToken = serverResponse.gssweb.token;
this.authInitSecContext();
break;
default:
// We have some server-reported error
this.error(
this.authInitSecContext();
break;
default:
// We have some server-reported error
this.error(
+ window.location.hostname +
" reported an error; aborting",
this.appTag
);
" reported an error; aborting",
this.appTag
);