[Rails5] Fix trusted proxies
What does this MR do?
There is a bug in trusted proxies.
This MR adds a monkey patch to fix the bug.
Example of errors:
1) trusted_proxies with default config preserves private IPs
Failure/Error: expect(request.ip).to eq('10.1.5.89')
expected: "10.1.5.89"
got: nil
(compared using ==)
# ./spec/initializers/trusted_proxies_spec.rb:12:in `block (3 levels) in <top (required)>'
2) trusted_proxies with default config filters out localhost
Failure/Error: expect(request.ip).to eq('10.1.5.89')
expected: "10.1.5.89"
got: "1.1.1.1"
(compared using ==)
# ./spec/initializers/trusted_proxies_spec.rb:18:in `block (3 levels) in <top (required)>'
Are there points in the code the reviewer needs to double check?
No.
Why was this MR needed?
Screenshots (if relevant)
No.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)