Add *args to Middleware and improve its type hints
#2381
Merged
*args to Middleware and improve its type hints
#2381