updated ajaxify 5xx handling code to work even if nginx is used as a proxy (as it serves back 502, not 500)

This commit is contained in:
Julian Lam
2015-07-13 15:49:21 -04:00
parent 81eeab42ed
commit f9a29186c4

View File

@@ -103,8 +103,11 @@ $(document).ready(function() {
if (data) {
var status = parseInt(data.status, 10);
if (status === 403 || status === 404 || status === 500 || status === 502) {
if (status === 502) {
status = 500;
}
if (status === 403 || status === 404 || status === 500) {
$('#footer, #content').removeClass('hide').addClass('ajaxifying');
return renderTemplate(url, status.toString(), data.responseJSON, (new Date()).getTime(), callback);
} else if (status === 401) {