You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This raises a TooManyHeaders(hdrs.X_FORWARDED_FOR) error. Upon inspection, I found that the line
request.headers.getall(hdrs.X_FORWARDED_FOR, [])
returns, in my case:
['192.168.0.1', '192.168.0.1']
I am still new to aiohttp_remotes, and I might be misunderstaning the error. However, it seems to me that duplicate IPs should not raise a TooManyHeaders error. If so, an easy fix would be to change the following line in aiohttp_remotes/x_forwarded.py
The text was updated successfully, but these errors were encountered:
mlaradji
changed the title
TooManyHeaders(hdrs.X_FORWARDED_FOR) is raised due to duplicate IPs
[Bug?] TooManyHeaders(hdrs.X_FORWARDED_FOR) is raised due to duplicate IPs
Apr 11, 2019
Since X-Forwarded-* limitations there is a genuine conflict when any header is encountered more than once.
That's why the library raises an exception for such case.
Standard Forwarded header supports multiple occurrences, it is the preferable approach for very many reasons.
I'm using aiohttp with aiohttp_remotes, and I want to execute the following line:
This raises a
TooManyHeaders(hdrs.X_FORWARDED_FOR)
error. Upon inspection, I found that the linereturns, in my case:
I am still new to aiohttp_remotes, and I might be misunderstaning the error. However, it seems to me that duplicate IPs should not raise a TooManyHeaders error. If so, an easy fix would be to change the following line in
aiohttp_remotes/x_forwarded.py
to
System Information
The text was updated successfully, but these errors were encountered: