Comparison

net/http/server.lua @ 4634:8e582afc214d

net.http.server: Fire global HTTP event when no specific handlers available.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 21 Apr 2012 17:38:01 +0500
parent 4633:92e1a538f8b0
child 4659:d53142e90cd0
comparison
equal deleted inserted replaced
4633:92e1a538f8b0 4634:8e582afc214d
127 end 127 end
128 until not event:find("/", 1, true);]] 128 until not event:find("/", 1, true);]]
129 --log("debug", "Event: %s", event); 129 --log("debug", "Event: %s", event);
130 if events.fire_event(event, payload) ~= nil then return; end 130 if events.fire_event(event, payload) ~= nil then return; end
131 -- TODO try adding/stripping / at the end, but this needs to work via an HTTP redirect 131 -- TODO try adding/stripping / at the end, but this needs to work via an HTTP redirect
132 if events.fire_event("*", payload) ~= nil then return; end
132 end 133 end
133 134
134 -- if handler not called, fallback to legacy httpserver handlers 135 -- if handler not called, fallback to legacy httpserver handlers
135 _M.legacy_handler(request, response); 136 _M.legacy_handler(request, response);
136 end 137 end