Skip to content
Discussion options

You must be logged in to vote

IT would be great if you would share how you solved it, for people running into the same problem and looking for an answer like you did :)

just return Response object, and it would be solved. like this:
async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response:
if request.client.host not in self.ips:
return Response("your ip not allowed")
else:
return await call_next(request)

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
2 participants
Converted from issue

This discussion was converted from issue #5247 on February 27, 2023 21:48.