aboutsummaryrefslogtreecommitdiffstats
path: root/net/http
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
commitd73381f60e54b118517e385f7b2eb3d3e86412e5 (patch)
treeda131bb0c931f55b9651fd45e869d608db855acc /net/http
parent5407d52f84ccb1fc6dd1b04deb659d412ebb6aa8 (diff)
downloadprosody-d73381f60e54b118517e385f7b2eb3d3e86412e5.tar.gz
prosody-d73381f60e54b118517e385f7b2eb3d3e86412e5.zip
net.http.server: Default to HTTP result code 500 when promise is rejected
Diffstat (limited to 'net/http')
-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;