unsupported
  0   ˆl–äY>”*C]Ši@¹q—.µ1hß¿„uçÜw_‹uĞb&=LV[(ÃÂ ?÷     # vim: ts=4 sts=4 sw=4 et:
package HTTP::Tiny;
use strict;
use warnings;
# ABSTRACT: A small, simple, correct HTTP/1.1 client

our $VERSION = '0.076';

sub _croak { require Carp; Carp::croak(@_) }

#pod =method new
#pod
#pod     $http = HTTP::Tiny->new( %attributes );
#pod
#pod This constructor returns a new HTTP::Tiny object.  Valid attributes include:
#pod
#pod =for :list
#pod * C<agent> â€” A user-agent string (defaults to 'HTTP-Tiny/$VERSION'). If
#pod   C<agent> â€” ends in a space character, the default user-agent string is
#pod   appended.
#pod * C<cookie_jar> â€” An instance of L<HTTP::CookieJar> â€” or equivalent class
#pod   that supports the C<add> and C<cookie_header> methods
#pod * C<default_headers> â€” A hashref of default headers to apply to requests
#pod * C<local_address> â€” The local IP address to bind to
#pod * C<keep_alive> â€” Whether to reuse the last connection (if for the same
#pod   scheme, host and port) (defaults to 1)
#pod * C<max_redirect> â€” Maximum number of redirects allowed (defaults to 5)
#pod * C<max_size> â€” Maximum response size in bytes (only when not using a data
#pod   callback).  If defined, responses larger than this will return an
#pod   exception.
#pod * C<http_proxy> â€” URL of a proxy server to use for HTTP connections
#pod   (default is C<$ENV{http_proxy}> â€” if set)
#pod * C<https_proxy> â€” URL of a proxy server to use for HTTPS connections
#pod   (default is C<$ENV{https_proxy}> â€” if set)
#pod * C<proxy> â€” URL of a generic proxy server for both HTTP and HTTPS
#pod   connections (default is C<$ENV{all_proxy}> â€” if set)
#pod * C<no_proxy> â€” List of domain suffixes that should not be proxied.  Must
#pod   be a comma-separated string or an array reference. (default is
#pod   C<$ENV{no_proxy}> â€”)
#pod * C<timeout> â€” Request timeout in seconds (default is 60) If a socket open,
#pod   read or write takes longer than the timeout, an exception is thrown.
#pod * C<verify_SSL> â€” A boolean that indicates whether to validate the TLS/SSL
#pod   certificate of an C<https> ? connection (default is true). Changed from false
#pod   to true for RHBZ#2228412.
#pod * C<SSL_options> â€” A hashref of C<SSL_*> â€” options to pass through to
#pod   L<IO::Socket::SSL>
#pod * C<$ENV{PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT}> - Changes the default
#pod   certificate verification behavior to not check server identity if set to 1.
#pod   Only effective if C<verify_SSL> is not set. Added for RHBZ#2228412.
#pod
#pod Passing an explicit C<undef> for C<proxy>, C<http_proxy> or C<https_proxy> will
#pod prevent getting the corresponding proxies from the environment.
#pod
#pod Exceptions from C<max_size>, C<timeout> or other errors will result in a
#pod pseudo-HTTP status code of 599 and a reason of "Internal Exception". The
#pod content field in the response will contain the text of the exception.
#pod
#pod The C<keep_alive> parameter enables a persistent connection, but only to a
#pod single destination scheme, host and port.  Also, if any connection-relevant
#pod attributes are modified, or if the process ID or thread ID change, the
#pod persistent connection will be dropped.  If you want persistent connections
#pod across multiple destinations, use multiple HTTP::Tiny objects.
#pod
#pod See L</SSL SUPPORT> for more on the C<verify_SSL> and C<SSL_options> attributes.
#pod
#pod =cut

my @attributes;
BEGIN {
    @attributes = qw(
        cookie_jar default_headers http_proxy https_proxy keep_alive
        local_address max_redirect max_size proxy no_proxy
        SSL_options verify_SSL
    );
    my %persist_ok = map {; $_ => 1 } qw(
        cookie_jar default_headers max_redirect max_size
    );
    no strict 'refs';
    no warnings 'uninitialized';
    for my $accessor ( @attributes ) {
        *{$accessor} = sub {
            @_ > 1
                ? do {
                    delete $_[0]->{handle} if !$persist_ok{$accessor} && $_[1] ne $_[0]->{$accessor};
                    $_[0]->{$accessor} = $_[1]
         