Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support redirect in http.server.handler() function for before_dispatch #74

Open
norguhtar opened this issue Feb 20, 2019 · 0 comments
Labels
feature A new functionality

Comments

@norguhtar
Copy link
Contributor

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
@Totktonada Totktonada added 1sp feature A new functionality labels Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

No branches or pull requests

3 participants