aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_errors.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
committerKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
commit1eabf5bdb449b0312dfa272884e02cc84175775c (patch)
tree94b4ebcb9443e8e6751e1903ade3c9dc8ec9d678 /plugins/mod_http_errors.lua
parent575cd4c57d062a1addc761aa0036b1db752900a9 (diff)
parent8537138d41a6bca5e855040c8928ef2aae59802f (diff)
downloadprosody-1eabf5bdb449b0312dfa272884e02cc84175775c.tar.gz
prosody-1eabf5bdb449b0312dfa272884e02cc84175775c.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_http_errors.lua')
-rw-r--r--plugins/mod_http_errors.lua37
1 files changed, 26 insertions, 11 deletions
diff --git a/plugins/mod_http_errors.lua b/plugins/mod_http_errors.lua
index 13473219..2158b403 100644
--- a/plugins/mod_http_errors.lua
+++ b/plugins/mod_http_errors.lua
@@ -26,21 +26,24 @@ local html = [[
<meta charset="utf-8">
<title>{title}</title>
<style>
-body{
- margin-top:14%;
- text-align:center;
- background-color:#F8F8F8;
- font-family:sans-serif;
+body {
+ margin-top : 14%;
+ text-align : center;
+ background-color : #F8F8F8;
+ font-family : sans-serif
}
-h1{
- font-size:xx-large;
+
+h1 {
+ font-size : xx-large
}
-p{
- font-size:x-large;
+
+p {
+ font-size : x-large
}
+
p+p {
- font-size:large;
- font-family:courier;
+ font-size : large;
+ font-family : courier
}
</style>
</head>
@@ -72,3 +75,15 @@ module:hook_object_event(server, "http-error", function (event)
end
return get_page(event.code, (show_private and event.private_message) or event.message);
end);
+
+module:hook_object_event(server, "http-error", function (event)
+ local request, response = event.request, event.response;
+ if request and response and request.path == "/" and response.status_code == 404 then
+ response.headers.content_type = "text/html; charset=utf-8";
+ return render(html, {
+ title = "Prosody is running!";
+ message = "Welcome to the XMPP world!";
+ });
+ end
+end, 1);
+