ProxyHeadersMiddleware crashes with gunicorn 24.1.0: AttributeError 'str' object has no attribute '_version' #2791
-
Summary
Versions
ErrorFile "/opt/pysetup/venv/lib/python3.13/site-packages/uvicorn/middleware/proxy_headers.py", line 95, in __init__
if "/" in host:
^^^^^^^^^^^
File "/usr/local/lib/python3.13/ipaddress.py", line 741, in __contains__
if self._version != other._version:
^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute '_version'Root CauseGunicorn 24.1.0 added CIDR network support (PR #3449) and now passes pre-parsed In Expected BehaviorUvicorn should handle both string and pre-parsed ipaddress objects from gunicorn. WorkaroundPin gunicorn to version < 24.1.0: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
They solved it. |
Beta Was this translation helpful? Give feedback.
They solved it.