-
-
Notifications
You must be signed in to change notification settings - Fork 951
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 middleware per Router
#2351
Conversation
@@ -650,6 +652,11 @@ def __init__( | |||
else: | |||
self.lifespan_context = lifespan | |||
|
|||
self.middleware_stack = self.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you'll comment about the names, but I prefer them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Do we need to update docs?
de102eb
to
11d5b8c
Compare
@encode/maintainers someone else wants to review this? |
@@ -615,6 +615,8 @@ def __init__( | |||
# the generic to Lifespan[AppType] is the type of the top level application | |||
# which the router cannot know statically, so we use typing.Any | |||
lifespan: typing.Optional[Lifespan[typing.Any]] = None, | |||
*, | |||
middleware: typing.Optional[typing.Sequence[Middleware]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use name middlewares
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we use middleware
everywhere already...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 Oh, I didn't even notice that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple and elegant modification
No description provided.