Задать вопрос

Тел: +7 965 3737 888

505

Просмотров

0

Ответов

Add get_addr() method to request object

<p>I thought it would be useful to have a get_addr() method available on request objects, similar to the get_host() provided by Django. This middleware will add a get_addr() method to requests which uses the X-Forwarded-For header (useful if you're behind a proxy) if it's present and you have the USE_X_FORWARDED_FOR header set to True (default is False) and otherwise will use the REMOTE_ADDR environment variable. Note that if you are <em>not</em> behind a proxy and have USE_X_FORWARDED_FOR set to True, then clients can spoof their IP by simply setting the X-Forwarded-For header.</p>

Вопрос полезен? Да0/Нет0
file_5134.py(1.2Кб)
None