Reverse named_response_middlware execution order, to match normal response middleware execution order.
Fixes #1847 Adds a test to ensure fix is correct Adds an example which demonstrates correct blueprint-middlware execution order behavior.
This commit is contained in:
@@ -653,7 +653,7 @@ class Sanic:
|
||||
if _rn not in self.named_response_middleware:
|
||||
self.named_response_middleware[_rn] = deque()
|
||||
if middleware not in self.named_response_middleware[_rn]:
|
||||
self.named_response_middleware[_rn].append(middleware)
|
||||
self.named_response_middleware[_rn].appendleft(middleware)
|
||||
|
||||
# Decorator
|
||||
def middleware(self, middleware_or_request):
|
||||
|
||||
Reference in New Issue
Block a user