starlette icon indicating copy to clipboard operation
starlette copied to clipboard

Support request.url_for in BaseMiddleware

Open Jdsleppy opened this issue 1 year ago • 0 comments

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.

Jdsleppy avatar Aug 25 '24 16:08 Jdsleppy