INNER CODE UNIT · Python
add_middleware
falconry/falcon · falcon/app.py:568
def add_middleware(
self,
middleware: SyncMiddleware[_ReqT, _RespT]
| Iterable[SyncMiddleware[_ReqT, _RespT]],
) -> None:
"""Add one or more additional middleware components.
Arguments:
middleware: Either a single middleware component or an iterable
of components to add. The component(s) will be invoked, in
order, as if they had been appended to the original middleware
list passed to the class initializer.
"""
# NOTE(kgriffs): Since this is called by the initializer, there is
# the chance that middleware may be empty.
if middleware:
try: