Closed nanobot248 closed 3 years ago
Are you seeing headers with for in a different position in the wild? My read of the spec was that the "for" section was always first, but I can see how it might be otherwise. If you're seeing them in a different order, that's certainly a bug. Would you mind providing a real world test case that you're seeing?
Basically, when i call Forwarded::value()
, it generates a string with the for=
pairs not being at the beginning of the string (it starts with by=
, then for=
, then host=
followed by proto=
). So at the moment, Forwarded
cannot parse its own generated header value.
I'm not sure about the current state of (reverse-)proxies. As far as i can tell, the x-forwarded-...
headers are still more common. But as always, if the spec allows it, someone is going to do it.
The
proxies::forwarded::Forwarded::parse
method currently (i'm using version 2.11.1) assumes, that allfor=
items are at the beginning of the forwarding header. As far as i can see from https://datatracker.ietf.org/doc/html/rfc7239#page-5 the RFC does not specify a specific position for thefor=
forwarded-pair.