Method: Puppet::HTTP::Redirector#redirect?

Defined in:
lib/puppet/http/redirector.rb

#redirect?(request, response) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determine of the HTTP response code indicates a redirect

Parameters:

Returns:

  • (Boolean)

    true if the response code is 301, 302, or 307.



24
25
26
27
28
29
30
31
32
33
# File 'lib/puppet/http/redirector.rb', line 24

def redirect?(request, response)
  # Net::HTTPRedirection is not used because historically puppet
  # has only handled these, and we're not a browser
  case response.code
  when 301, 302, 307
    true
  else
    false
  end
end