-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper RFC 7239 support for 'Forwarded' header #7
Comments
It seems that we should handle the |
Agreed, it makes more sense to have |
I actually disagree. I believe this module should really be refactored because it already has some other issues. For example, it doesn't handle It also doesn't even look at the I would be happy to submit a refactor that handles these different cases properly later if I get a few minutes. The fundamental problem is that this module tries to handle all the different headers in a generic way and in reality each header needs special treatment. I'll take a crack at it and create a pull request later today hopefully if you guys are open to it. |
It seems to me that it correctly handles a comma separated list of IPs for the |
Ah, it looks like spaces are breaking the handling of the ips = (headers[proxies[i].ip] || '').split(/\s*,\s*/); |
It should work anyway as the "standard" syntax is this:
The resulting In the worst case you'll end up having P.S. Here is a parser for the |
@jwarkentin you were right here. This should be fixed in the latest version (1.0.1). |
Forwarded header (RFC 7239) is still not supported. |
True, I should've clarified that I was speaking about the |
Forwarded header (RFC 7239) is still not supported. |
@mkolmhuber feel free to open a PR to add support for it via |
See RFC 7239 for specifics, but basically the
Forwarded
header should support values like these:According the the RFC the
Forwarded
header supports the following case-insensitive parameters separated by a semicolon (and optional space):for
,by
,proto
andhost
It does not support just a plain IP address as the code currently accepts.
Each of those parameters can be a comma separated list.
The RFC is pretty straight forward. You've created a very helpful module here and it would be very nice to have support for that header with it!
The text was updated successfully, but these errors were encountered: