Loading lib/httpx/plugins/ssrf_filter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ module HTTPX SsrfFilter.unsafe_ip_address?(ipaddr) || @options.extra_unsafe_ranges&.any? { |r| r.include?(ipaddr) } end raise ServerSideRequestForgeryError, "#{@origin.host} has no public IP addresses" if addrs.empty? raise ServerSideRequestForgeryError, "#{@origin.host} has no allowed IP addresses" if addrs.empty? super end Loading test/support/requests/plugins/ssrf_filter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ module Requests start_test_servlet(dns_spoof_resolver) do |spoof_dns| HTTPX.plugin(SessionWithPool).plugin(:ssrf_filter).wrap do |session| response = session.get("https://wqwereasdsada.xyz", resolver_options: { nameserver: [spoof_dns.nameserver], cache: false }) verify_error_response(response, "wqwereasdsada.xyz has no public IP addresses") verify_error_response(response, "wqwereasdsada.xyz has no allowed IP addresses") end end end unless RUBY_ENGINE == "jruby" Loading Loading
lib/httpx/plugins/ssrf_filter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ module HTTPX SsrfFilter.unsafe_ip_address?(ipaddr) || @options.extra_unsafe_ranges&.any? { |r| r.include?(ipaddr) } end raise ServerSideRequestForgeryError, "#{@origin.host} has no public IP addresses" if addrs.empty? raise ServerSideRequestForgeryError, "#{@origin.host} has no allowed IP addresses" if addrs.empty? super end Loading
test/support/requests/plugins/ssrf_filter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ module Requests start_test_servlet(dns_spoof_resolver) do |spoof_dns| HTTPX.plugin(SessionWithPool).plugin(:ssrf_filter).wrap do |session| response = session.get("https://wqwereasdsada.xyz", resolver_options: { nameserver: [spoof_dns.nameserver], cache: false }) verify_error_response(response, "wqwereasdsada.xyz has no public IP addresses") verify_error_response(response, "wqwereasdsada.xyz has no allowed IP addresses") end end end unless RUBY_ENGINE == "jruby" Loading