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

Document that middleware factories are run for every request. #2230

Merged
merged 1 commit into from
Aug 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/2225.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document that all app's middleware factories are run for every request.
5 changes: 5 additions & 0 deletions docs/web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,11 @@ the **next** *middleware factory*. The last *middleware factory* always receives
the :ref:`request handler <aiohttp-web-handler>` selected by the router itself
(by :meth:`UrlDispatcher.resolve`).

.. note::

Both the outer *middleware_factory* coroutine and the inner
*middleware_handler* coroutine are called for every request handled.

*Middleware factories* should return a new handler that has the same signature
as a :ref:`request handler <aiohttp-web-handler>`. That is, it should accept a
single :class:`Request` instance and return a :class:`Response`, or raise an
Expand Down