Netflix / zuul

Zuul is a gateway service that provides dynamic routing, monitoring, resiliency, security, and more.
Apache License 2.0
13.53k stars 2.39k forks source link

X-Forwarded-Port multiple value throw NumberFormatException #1821

Open sweat123 opened 2 months ago

sweat123 commented 2 months ago

In my environment, the request will be handle by two proxy. When the last zuul gateway receive the request, there are multiple value in header 'X-Forwarded-Port', likes thus:

X-Forwarded-Port: 9002,11000

The multiple port value case the exception in HttpRequestMessageImpl#getOriginalPort(SessionContext context, Headers headers, int serverPort).

image

Although XXF-Port should not have multiple values, but this problem may be more frequent and we should avoid it as much as possible. So I think zuul need get the most left value in 'X-Forwarded-Port' to avoid the Exception.

github-actions[bot] commented 1 day ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.