Skip to content

Node.js based forum software built for the modern web

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

Julian Lamf9a29186c4ed
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index ef990b405e..52d6b77feb 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -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) {