Closed raphaelbauer closed 10 years ago
You can do, or if you want the default behaviour just use getHttpRequest().getRemoteAddr()
Sure - but some people are using context.getRemoteAddr() already and may be surprised with the change (positive or negative depending on the configuration of their firewalls and reverse proxies ;) ).
Anyway - I added a configuration variable to enable the feature (ninja.x_forwarded_for_enabled). I think that's cool and easy.
Check out: https://github.com/ninjaframework/ninja/pull/225 All feedback welcome :)
@dazhudson I'd like to add a toggle to application.conf that enables this feature only if it is set to true. I can think of all sorts of strange security issues when the frontend facing proxy is not configured properly, or the users are not 100% sure what they are doing.
Something like: ninja.x-forwarded-for=true|false
Let me know what you think!