feat: trustProxy: 'railway' - #50
Merged
Merged
Conversation
Railway's edge replaces any client-sent X-Forwarded-For with exactly '<client>, <edge>', so the visitor is two entries from the right. A depth of 1 (and the Next.js and Hono default) names the edge for every visitor. 'railway' resolves exactly as a depth of 2, in the one shared resolver, so every adapter gets it. Also documents that Fastify 5.12+ ignores a numeric server trustProxy (it fails closed), so the hop count belongs on the plugin. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
'railway'toTrustedProxies, resolved in the sharedresolveClientIpso every adapter gets it.Railway's edge replaces any client-sent
X-Forwarded-Forwith exactly<client>, <edge>(checked against a live deploy: forged values are dropped). A depth of1, which is also the Next.js and Hono default, names the edge for every visitor.'railway'answers exactly what a depth of2answers; the tests pin that and fail if the depth is changed to 1.Also documents that Fastify 5.12+ fails closed on a numeric server
trustProxy(request.ipstays the socket address), so the hop count belongs on the plugin.All workspace tests, build, lint and the edge check pass locally.
🤖 Generated with Claude Code