diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2014-02-21 08:12:35 +0000 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-02-21 08:12:35 +0000 |
commit | 56e971472aeadd8c59894759279df45820a0c18d (patch) | |
tree | 08f866be0de61db666dbe6e61d043a18a1a31d20 /cpan/HTTP-Tiny | |
parent | e486a1153d6d3df960580860310624c061c23e2d (diff) | |
download | perl-56e971472aeadd8c59894759279df45820a0c18d.tar.gz |
Upgrade HTTP-Tiny from version 0.042 to 0.043
Diffstat (limited to 'cpan/HTTP-Tiny')
-rw-r--r-- | cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | 16 | ||||
-rw-r--r-- | cpan/HTTP-Tiny/t/Util.pm | 4 |
2 files changed, 13 insertions, 7 deletions
diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm index 6db995ce5d..e348753b93 100644 --- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm +++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm @@ -3,7 +3,7 @@ package HTTP::Tiny; use strict; use warnings; # ABSTRACT: A small, simple, correct HTTP/1.1 client -our $VERSION = '0.042'; # VERSION +our $VERSION = '0.043'; # VERSION use Carp (); @@ -466,6 +466,7 @@ sub _request { my $request = { method => $method, scheme => $scheme, + host => $host, host_port => ($port == $DefaultPort{$scheme} ? $host : "$host:$port"), uri => $path_query, headers => {}, @@ -545,8 +546,6 @@ sub _open_handle { sub _proxy_connect { my ($self, $request, $handle) = @_; - $request->{uri} = "$request->{scheme}://$request->{host_port}$request->{uri}"; - my @proxy_vars; if ( $request->{scheme} eq 'https' ) { Carp::croak(qq{No https_proxy defined}) unless $self->{https_proxy}; @@ -568,8 +567,13 @@ sub _proxy_connect { $handle->connect($p_scheme, $p_host, $p_port); - $self->_create_proxy_tunnel( $request, $handle ) - if $request->{scheme} eq 'https'; + if ($request->{scheme} eq 'https') { + $self->_create_proxy_tunnel( $request, $handle ); + } + else { + # non-tunneled proxy requires absolute URI + $request->{uri} = "$request->{scheme}://$request->{host_port}$request->{uri}"; + } return $handle; } @@ -1424,7 +1428,7 @@ HTTP::Tiny - A small, simple, correct HTTP/1.1 client =head1 VERSION -version 0.042 +version 0.043 =head1 SYNOPSIS diff --git a/cpan/HTTP-Tiny/t/Util.pm b/cpan/HTTP-Tiny/t/Util.pm index d3f3fa4dc5..2428053c07 100644 --- a/cpan/HTTP-Tiny/t/Util.pm +++ b/cpan/HTTP-Tiny/t/Util.pm @@ -166,7 +166,9 @@ sub sort_headers { }; *HTTP::Tiny::Handle::close = sub { 1 }; # don't close our temps - delete $ENV{http_proxy}; # don't try to proxy in mock-mode + # don't try to proxy in mock-mode + delete $ENV{http_proxy}; + delete $ENV{$_} for map { $_, uc($_) } qw/https_proxy all_proxy/; } } |