aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-09-28 16:21:41 +0100
committerMatthew Wild <mwild1@gmail.com>2020-09-28 16:21:41 +0100
commit9229c7a57188168e992145e4f3be6fd381ffe90c (patch)
treeda131bb0c931f55b9651fd45e869d608db855acc
parent04be6c2e839894756eaf4a3aa53a823508f14b12 (diff)
downloadprosody-9229c7a57188168e992145e4f3be6fd381ffe90c.tar.gz
prosody-9229c7a57188168e992145e4f3be6fd381ffe90c.zip
net.http.server: Default to HTTP result code 500 when promise is rejected
-rw-r--r--net/http/server.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/http/server.lua b/net/http/server.lua
index f563d330..0070367a 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -197,6 +197,7 @@ local function handle_result(request, response, result)
result:next(function (ret)
handle_result(request, response, ret);
end, function (err)
+ response.status_code = 500;
handle_result(request, response, err or 500);
end);
return true;