mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-28 17:50:01 +01:00
Update RemoteIp patch with Rails 8.1 changes (#38139)
This commit is contained in:
@@ -17,11 +17,11 @@ module ActionDispatch
|
||||
module GetIpExtensions
|
||||
def calculate_ip
|
||||
# Set by the Rack web server, this is a single value.
|
||||
remote_addr = ips_from(@req.remote_addr).last
|
||||
remote_addr = sanitize_ips(ips_from(@req.remote_addr)).last
|
||||
|
||||
# Could be a CSV list and/or repeated headers that were concatenated.
|
||||
client_ips = ips_from(@req.client_ip).reverse!
|
||||
forwarded_ips = ips_from(@req.x_forwarded_for).reverse!
|
||||
client_ips = sanitize_ips(ips_from(@req.client_ip)).reverse!
|
||||
forwarded_ips = sanitize_ips(@req.forwarded_for || []).reverse!
|
||||
|
||||
# `Client-Ip` and `X-Forwarded-For` should not, generally, both be set. If they
|
||||
# are both set, it means that either:
|
||||
|
||||
Reference in New Issue
Block a user