Netflix/zuul

X-Forwarded-Port multiple value throw NumberFormatException

sweat123 opened this issue · 2 comments

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.