always convert trusted proxies to string#1288
Conversation
fix getsentry#1274 `IPAddr.new` only accept the address as a string but not as an `IPAddr` as suggested in the Rails documentation https://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html
st0012
left a comment
There was a problem hiding this comment.
thanks for the PR, but I think the solution can still be improved 🙂
although sentry-rails is where most users would register the trusted proxies, config.trusted_proxies is also a public configuration option. so even though the PR can stop most of the problematic cases, it doesn't prevent users from manually injecting the converted ip addresses. imo, it's the Utils::RealIP's responsibility to check every ip address' type and whether to convert them.
also, there should be test cases to cover the situation this PR wants to address.
st0012
left a comment
There was a problem hiding this comment.
thanks for the fix! can you also add a changelog entry?
I did it by hand. As it's not possible to do it with craft when it's not the master branch. Can be interesting for next time 😉 to add on the |
|
@gagalago thanks for the advice 😄 I also add changelogs by hand tbh. but I'll mention the changelog entry in the pr template 👍 |
fix #1274
Description
IPAddr.newonly accept the address as a string but not as anIPAddras suggested in the Rails documentation.