Add ::1 to default forwarded-allow-ips
See original GitHub issueChecklist
- The bug is reproducible against the latest release and/or
master
. - There are no similar issues or pull requests to fix it yet.
Describe the bug
--forwarded-allow-ips
currently defaults to 127.0.0.1
. It should default to ::1,127.0.0.1
as it’s the year 2021.
To reproduce
Inspect the request object with the default --forwarded-allow-ips
.
Expected behavior
For --forwarded-allow-ips
to default to ::1,127.0.0.1
.
Actual behavior
--forwarded-allow-ips
defaults to 127.0.0.1
.
Debugging material
None.
Environment
-
OS / Python / Uvicorn version: just run
uvicorn --version
Running uvicorn 0.12.3 with CPython 3.7.3 on Linux -
The exact command you’re running uvicorn with, all flags you passed included. If you run it with gunicorn please do the same. If there is a reverse-proxy involved and you cannot reproduce without it please give the minimal config of it to reproduce.
/opt/clusterapi/bin/python3.7 /opt/clusterapi/bin/uvicorn --host :: --port 5000 app.main:app --workers 9 --proxy-headers
Additional context
None.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
most server I’m familiar with use ipv4 for the proxy headers defaults, at least gunicorn I’m pretty sure of it. is there a good argument appart from it’s the year 2021 ? happy to re-open of course if there is !
How are you going to receive external, firewallable traffic on a loopback interface? Or disable SLAAC.