diff options
author | Kim Alvefur <zash@zash.se> | 2021-02-25 12:59:28 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-02-25 12:59:28 +0100 |
commit | 3180f48bc582fe8d48c8e5000e34c1934f6a7995 (patch) | |
tree | 75eba420b874b8230fa75301f4815f6fd40b20e1 | |
parent | 0a5ac437b9b7399b80fdf3cc0253aa15d96da08f (diff) | |
download | prosody-3180f48bc582fe8d48c8e5000e34c1934f6a7995.tar.gz prosody-3180f48bc582fe8d48c8e5000e34c1934f6a7995.zip |
mod_http_errors: Add some silly variations for the '/' page
> "You can do anything in XMPP!"
> as a reminiscence of zombo.com
-- jonas’
> A study in simplicity.
Prosody tagline
-rw-r--r-- | plugins/mod_http_errors.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/mod_http_errors.lua b/plugins/mod_http_errors.lua index dca36d76..be07a43b 100644 --- a/plugins/mod_http_errors.lua +++ b/plugins/mod_http_errors.lua @@ -15,6 +15,15 @@ local default_messages = { "Where did you put it?", "It's behind you.", "Keep looking." }; [500] = { "% Check your error log for more info."; "Gremlins.", "It broke.", "Don't look at me." }; + ["/"] = { + "A study in simplicity."; + "Better catch it!"; + "Don't just stand there, go after it!"; + "Well, say something, before it runs too far!"; + "Welcome to the world of XMPP!"; + "You can do anything in XMPP!"; -- "The only limit is XML."; + "You can do anything with Prosody!"; -- the only limit is memory? + }; }; local messages = setmetatable(module:get_option("http_errors_messages", {}), { __index = default_messages }); @@ -78,9 +87,10 @@ 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"; + local message = messages["/"]; return render(html, { title = "Prosody is running!"; - message = "Welcome to the XMPP world!"; + message = message[math.random(#message)]; }); end end, 1); |