uvicorn
uvicorn copied to clipboard
Add CIDR optionality to `ProxyHeadersMiddleware`
Summary
Added the ability to pass CIDRs to ProxyHeadersMiddleware using the stdlib ipaddress library. This should fix this comment - https://github.com/encode/uvicorn/issues/1068#issuecomment-1004813267
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.