Build request.url from structured components by Kludex · Pull Request #3326 · Kludex/starlette (original) (raw)
Construct request.url from the scope by assembling structured URL components and serializing them, instead of concatenating {scheme}://{host}{path} strings by hand.
This keeps the path from being placed directly against the authority when it does not start with /, so the resulting URL parses back into the components it was built from.
AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.