Module: HTTPX::Plugins::FollowRedirects

Defined in:
lib/httpx/plugins/follow_redirects.rb

Overview

This plugin adds support for automatically following redirect (status 30X) responses.

It has a default upper bound of followed redirects (see MAX_REDIRECTS and the max_redirects option), after which it will return the last redirect response. It will not raise an exception.

It doesn’t follow insecure redirects (https -> http) by default (see follow_insecure_redirects).

It doesn’t propagate authorization related headers to requests redirecting to different origins (see allow_auth_to_other_origins) to override.

It allows customization of when to redirect via the redirect_on callback option).

gitlab.com/os85/httpx/wikis/Follow-Redirects

Defined Under Namespace

Modules: ConnectionMethods, InstanceMethods, OptionsMethods, RequestMethods

Constant Summary collapse

MAX_REDIRECTS =
3
REDIRECT_STATUS =
(300..399).freeze
REQUEST_BODY_HEADERS =
%w[transfer-encoding content-encoding content-type content-length content-language content-md5 trailer].freeze