Skip to content

Commit

Permalink
fix(web-server): allow for trusted proxies not be set
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Mar 6, 2024
1 parent d1e5b68 commit 4e1deb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/trusted_proxies.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

Rack::Request.ip_filter = lambda { |ip|
if Postal::Config.postal.trusted_proxies.any? { |net| net.include?(ip) } ||
if Postal::Config.postal.trusted_proxies&.any? { |net| net.include?(ip) } ||
ip.match(/\A127\.0\.0\.1\Z|\A::1\Z|\Afd[0-9a-f]{2}:.+|\Alocalhost\Z|\Aunix\Z|\Aunix:/i)
true
else
Expand Down

0 comments on commit 4e1deb2

Please sign in to comment.