Replies: 4 comments
-
Thanks for the report on the issue in our documentation! I have moved you report over to the documentation repository so we can track fixing the documentation. You are always welcome to make a PR to fix the documentation if you're willing, otherwise we will make sure the text is updated to better reflect the design. |
Beta Was this translation helpful? Give feedback.
-
Wouldn't this be a software bug, instead of a documentation one? For me, the documented behavior makes much more sense than the |
Beta Was this translation helpful? Give feedback.
-
Hi @thinety it certainly could be, though it is more often than not that the documentation is wrong, especially as the majority of it was written by a third-party company that was hired to write it. Of course, suddenly changing the behavior would cause all types of breakage for the code written on express that expects the current behavior. If you believe this is some regression in the code, if you could point out which version of Express the behavior this changed in, we can assess on how impactful it would be on the ecosystem to actually alter the behavior as a bug fix. |
Beta Was this translation helpful? Give feedback.
-
Oh yes, I see. I don't think it is a regression (git blame shows commits from 7 years ago), so in that case it altering this behavior as a bug fix would probably break more core than fix. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
According to documentation,
req.ips
isMy understanding is that this array should contain all IPs up to, but not including, the first trusted one. Although it is not explicit in the documentation, this excerpt endorses my speculation:
The problem is that this expected behavior is not what actually happens. In the getter for
req.ips
,proxyaddr.all
is used, which according to documentation returnsSo, supposing
app.set('trust proxy', 1)
, with theX-Forwarded-For
header mentioned above,req.ips
is["proxy2"]
, going against the documentation.Beta Was this translation helpful? Give feedback.
All reactions