spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Support `by` component of `Forwarded` header

Open idealo-ricardo-band opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

All of our HTTP components (mostly proxies) write Forwarded headers. That gives us some kind of traceroute of the HTTP traffic path which helps a lot when debugging. Only our Spring Cloud Gateway based part is not providing the by attribute of the Forwarded header. So we can't see where the traffic came from to it.

Describe the solution you'd like

It would be nice to fill the by component of the Forwarded header with the IP and port of the host that runs Spring Cloud Gateway. That way we can see which of our nodes received the traffic.

Describe alternatives you've considered We could add our own header for that but why would we do that if there already is a standard way to do that. ;)

Additional context

Other entries in our Forwarded headers look like this with all attributes filled:

by=62.1.2.3:443;for=89.1.2.3:42857;host=www.mysite.com;proto=https

The entry from our Spring Cloud Gateway based component looks like this:

proto=http;host=www.myintsite.com;for="10.1.2.3:36286"

Also I still understand rfc7230#section-3.2.6 that an IPv4 address is a normal token and doesn't need to be quoted. I've also never seen official examples of a quoted IPv4 address. That should only be needed for IPv6 addresses because they contain []:.

A TODO note is already in place :)

idealo-ricardo-band avatar Jun 28 '22 14:06 idealo-ricardo-band

Any updates on this?

idealo-ricardo-band avatar Aug 26 '22 14:08 idealo-ricardo-band

Another 3 months later. Any updates on this?

idealo-ricardo-band avatar Oct 20 '22 09:10 idealo-ricardo-band

Now a whole year went past. Guess this project is either dead or doesn't care about standards from 2017..

idealo-ricardo-band avatar Sep 13 '23 09:09 idealo-ricardo-band

Closing in favor of #2658

spencergibb avatar Mar 13 '24 19:03 spencergibb