settings: Ensure client IP is correctly extracted from HTTP header
The X-Original-Forwarded-For header value has the following format: client[, proxy1, proxy2] So ensure to handle all cases when extracting client IP from it to avoid error when django-ratelimit processes a content view request.
Showing
- swh/web/browse/tests/views/test_content.py 19 additions, 0 deletionsswh/web/browse/tests/views/test_content.py
- swh/web/settings/common.py 4 additions, 0 deletionsswh/web/settings/common.py
- swh/web/settings/production.py 0 additions, 4 deletionsswh/web/settings/production.py
- swh/web/tests/helpers.py 2 additions, 0 deletionsswh/web/tests/helpers.py
Please register or sign in to comment