http
http copied to clipboard
Add support redirect in http.server.handler() function for before_dispatch
Hello. Can you add support return response from befor_dispatch function? It may usefull for handle bearing token auth or basic auth. I think you can change code like this:
local function handler(self, request)
if self.hooks.before_dispatch ~= nil then
- self.hooks.before_dispatch(self, request)
+ local resp = self.hooks.before_dispatch(self, request)
+
+ if resp then
+ return resp
+ end
end