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
125 def initialize(*)
126   begin
127     super
128   rescue ServerSideRequestForgeryError => e
129     # may raise when IPs are passed as options via :addresses
130     throw(:resolve_error, e)
131   end
132 end

Public Instance methods

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