diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-08-11 20:49:19 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-08-11 20:49:19 +0100 |
commit | 322ae8a3c5933310bbab49ca3eaacfd162001863 (patch) | |
tree | eff8adb344da4820c910a24b16ab5b77a4d006c3 /net | |
parent | 928fb0e2e23412b39363f87a8d5030d5be17a55a (diff) | |
download | prosody-322ae8a3c5933310bbab49ca3eaacfd162001863.tar.gz prosody-322ae8a3c5933310bbab49ca3eaacfd162001863.zip |
net.httpserver: Allow overriding default request handler
Diffstat (limited to 'net')
-rw-r--r-- | net/httpserver.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/httpserver.lua b/net/httpserver.lua index 77590519..56dfe04e 100644 --- a/net/httpserver.lua +++ b/net/httpserver.lua @@ -89,9 +89,6 @@ local function call_callback(request, err) end callback = (request.server and request.server.handlers[base]) or default_handler; - if callback == default_handler then - log("debug", "Default callback for this request (base: "..tostring(base)..")") - end end if callback then if err then @@ -251,6 +248,10 @@ function new(params) end end +function set_default_handler(handler) + default_handler = handler; +end + function new_from_config(ports, default_base, handle_request) for _, options in ipairs(ports) do local port, base, ssl, interface = 5280, default_base, false, nil; |