From f55f0ab0c35e13744f05d6643600e6907b24226a Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Thu, 3 Aug 2023 10:05:35 +0200 Subject: [PATCH] Allow spaces around commas in ALLOWED_PRIVATE_ADDRESSES (#26297) --- app/lib/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/request.rb b/app/lib/request.rb index adc9a48f3..e5a9476a8 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -346,7 +346,7 @@ class Request 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