starlette
starlette copied to clipboard
Support request.url_for in BaseMiddleware
Summary
Resolve the bug (or limitation) in this related discussion where Request.url_for() cannot be called in a middleware inheriting from BaseHTTPMiddleware before the Router/call_next is invoked.
Checklist
- [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [x] I've updated the documentation accordingly.