Skip to content

Commit

Permalink
Allow spaces around commas in ALLOWED_PRIVATE_ADDRESSES
Browse files Browse the repository at this point in the history
To be consistent with how TRUSTED_PROXY_IP is parsed.
  • Loading branch information
progval authored Aug 2, 2023
1 parent 2cbdff9 commit 42f3430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def check_private_address(address, host)
end

def private_address_exceptions
@private_address_exceptions = (ENV['ALLOWED_PRIVATE_ADDRESSES'] || '').split(',').map { |addr| IPAddr.new(addr) }
@private_address_exceptions = (ENV['ALLOWED_PRIVATE_ADDRESSES'] || '').split(/(?:\s*,\s*|\s+)/).map { |addr| IPAddr.new(addr) }
end
end
end
Expand Down

0 comments on commit 42f3430

Please sign in to comment.