module HTTPX::Plugins::SsrfFilter::ConnectionMethods

  1. lib/httpx/plugins/ssrf_filter.rb

Methods

Public Class

  1. new

Public Instance

  1. addresses=

Public Class methods

new(*)
[show source]
    # File lib/httpx/plugins/ssrf_filter.rb
124 def initialize(*)
125   begin
126     super
127   rescue ServerSideRequestForgeryError => e
128     # may raise when IPs are passed as options via :addresses
129     throw(:resolve_error, e)
130   end
131 end

Public Instance methods

addresses=(addrs)
[show source]
    # File lib/httpx/plugins/ssrf_filter.rb
133 def addresses=(addrs)
134   addrs.reject!(&SsrfFilter.method(:unsafe_ip_address?))
135 
136   raise ServerSideRequestForgeryError, "#{@origin.host} has no public IP addresses" if addrs.empty?
137 
138   super
139 end