Hello community,
here is the log from the commit of package perl-AnyEvent-HTTP for
openSUSE:Factory checked in at 2014-07-26 09:42:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-AnyEvent-HTTP (Old)
and /work/SRC/openSUSE:Factory/.perl-AnyEvent-HTTP.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-AnyEvent-HTTP"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-AnyEvent-HTTP/perl-AnyEvent-HTTP.changes
2013-06-05 17:47:17.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-AnyEvent-HTTP.new/perl-AnyEvent-HTTP.changes
2014-07-26 09:42:13.000000000 +0200
@@ -1,0 +2,14 @@
+Fri Jul 25 09:32:00 UTC 2014 - [email protected]
+
+- updated to 2.21
+ - correctly keep body when redirecting POSTs, instead of
+ deleting them.
+
+ 2.2 Mon Jun 9 01:31:46 CEST 2014
+ - connection header was malformed (patch by Raphael Geissert).
+ - add lots of known idempotent methods from httpbis.
+ - implement relative location headers (rfc 7231), with fallback on
URI.
+ - add support for status code 308 from rfc 7238.
+ - recommend URI.
+
+-------------------------------------------------------------------
Old:
----
AnyEvent-HTTP-2.15.tar.gz
New:
----
AnyEvent-HTTP-2.21.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-AnyEvent-HTTP.spec ++++++
--- /var/tmp/diff_new_pack.MU05Uu/_old 2014-07-26 09:42:14.000000000 +0200
+++ /var/tmp/diff_new_pack.MU05Uu/_new 2014-07-26 09:42:14.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-AnyEvent-HTTP
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: perl-AnyEvent-HTTP
-Version: 2.15
+Version: 2.21
Release: 0
%define cpan_name AnyEvent-HTTP
Summary: Simple but non-blocking HTTP/HTTPS client
@@ -31,13 +31,9 @@
BuildRequires: perl-macros
BuildRequires: perl(AnyEvent) >= 5.33
BuildRequires: perl(common::sense) >= 3.3
-#BuildRequires: perl(AnyEvent::Handle)
-#BuildRequires: perl(AnyEvent::HTTP)
-#BuildRequires: perl(AnyEvent::Impl::Perl)
-#BuildRequires: perl(AnyEvent::Socket)
-#BuildRequires: perl(AnyEvent::Util)
Requires: perl(AnyEvent) >= 5.33
Requires: perl(common::sense) >= 3.3
+Recommends: perl(URI)
%{perl_requires}
%description
++++++ AnyEvent-HTTP-2.15.tar.gz -> AnyEvent-HTTP-2.21.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AnyEvent-HTTP-2.15/Changes
new/AnyEvent-HTTP-2.21/Changes
--- old/AnyEvent-HTTP-2.15/Changes 2012-11-14 23:22:10.000000000 +0100
+++ new/AnyEvent-HTTP-2.21/Changes 2014-06-09 01:36:23.000000000 +0200
@@ -1,11 +1,23 @@
Revision history for AnyEvent::HTTP
TODO: provide lwp_request function that takes an lwp http requets and returns
a http response.
-TODO: httpbis: $location = URI->new_abs($location,
"$scheme://$host:$port$path_query")->as_string;
TODO: set_proxy hook
TODO: use proxy hook
TODO: ip6 literals in url
TODO: maybe read big chunks in smaller portions for chunked-encoding + on_body.
+TODL: on_upgrade, for 101 responses?
+TODO: document session vs. sessionid correctly.
+
+2.21 Mon Jun 9 01:35:54 CEST 2014
+ - correctly keep body when redirecting POSTs, instead of
+ deleting them.
+
+2.2 Mon Jun 9 01:31:46 CEST 2014
+ - connection header was malformed (patch by Raphael Geissert).
+ - add lots of known idempotent methods from httpbis.
+ - implement relative location headers (rfc 7231), with fallback on URI.
+ - add support for status code 308 from rfc 7238.
+ - recommend URI.
2.15 Wed Nov 14 23:22:07 CET 2012
- use the recurse parameter to also limit the number of retries to be
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AnyEvent-HTTP-2.15/HTTP.pm
new/AnyEvent-HTTP-2.21/HTTP.pm
--- old/AnyEvent-HTTP-2.15/HTTP.pm 2012-11-14 23:22:00.000000000 +0100
+++ new/AnyEvent-HTTP-2.21/HTTP.pm 2014-06-09 01:35:52.000000000 +0200
@@ -48,7 +48,7 @@
use base Exporter::;
-our $VERSION = '2.15';
+our $VERSION = 2.21;
our @EXPORT = qw(http_get http_post http_head http_request);
@@ -91,7 +91,7 @@
destroyed before the callback is called, the request will be cancelled.
The callback will be called with the response body data as first argument
-(or C<undef> if an error occured), and a hash-ref with response headers
+(or C<undef> if an error occurred), and a hash-ref with response headers
(and trailers) as second argument.
All the headers in that hash are lowercased. In addition to the response
@@ -125,7 +125,7 @@
=over 4
-=item 595 - errors during connection etsbalishment, proxy handshake.
+=item 595 - errors during connection establishment, proxy handshake.
=item 596 - errors during TLS negotiation, request sending and header
processing.
@@ -159,6 +159,11 @@
Whether to recurse requests or not, e.g. on redirects, authentication and
other retries and so on, and how often to do so.
+Only redirects to http and https URLs are supported. While most common
+redirection forms are handled entirely within this module, some require
+the use of the optional L<URI> module. If it is required but missing, then
+the request will fail with an error.
+
=item headers => hashref
The request headers to use. Currently, C<http_request> may provide its own
@@ -244,7 +249,7 @@
=item on_prepare => $callback->($fh)
In rare cases you need to "tune" the socket before it is used to
-connect (for exmaple, to bind it on a given IP address). This parameter
+connect (for example, to bind it on a given IP address). This parameter
overrides the prepare callback passed to C<AnyEvent::Socket::tcp_connect>
and behaves exactly the same way (e.g. it has to provide a
timeout). See the description for the C<$prepare_cb> argument of
@@ -691,6 +696,44 @@
()
}
+our %IDEMPOTENT = (
+ DELETE => 1,
+ GET => 1,
+ HEAD => 1,
+ OPTIONS => 1,
+ PUT => 1,
+ TRACE => 1,
+
+ ACL => 1,
+ "BASELINE-CONTROL" => 1,
+ BIND => 1,
+ CHECKIN => 1,
+ CHECKOUT => 1,
+ COPY => 1,
+ LABEL => 1,
+ LINK => 1,
+ MERGE => 1,
+ MKACTIVITY => 1,
+ MKCALENDAR => 1,
+ MKCOL => 1,
+ MKREDIRECTREF => 1,
+ MKWORKSPACE => 1,
+ MOVE => 1,
+ ORDERPATCH => 1,
+ PROPFIND => 1,
+ PROPPATCH => 1,
+ REBIND => 1,
+ REPORT => 1,
+ SEARCH => 1,
+ UNBIND => 1,
+ UNCHECKOUT => 1,
+ UNLINK => 1,
+ UNLOCK => 1,
+ UPDATE => 1,
+ UPDATEREDIRECTREF => 1,
+ "VERSION-CONTROL" => 1,
+);
+
sub http_request($$@) {
my $cb = pop;
my ($method, $url, %arg) = @_;
@@ -775,7 +818,7 @@
$hdr{"content-length"} = length $arg{body}
if length $arg{body} || $method ne "GET";
- my $idempotent = $method =~ /^(?:GET|HEAD|PUT|DELETE|OPTIONS|TRACE)$/;
+ my $idempotent = $IDEMPOTENT{$method};
# default value for keepalive is true iff the request is for an idempotent
method
my $persistent = exists $arg{persistent} ? !!$arg{persistent} : $idempotent;
@@ -785,7 +828,7 @@
# the key to use in the keepalive cache
my $ka_key = "$uscheme\x00$uhost\x00$uport\x00$arg{sessionid}";
- $hdr{connection} = ($persistent ? $keepalive ? "keep-alive " : "" : "close
") . "Te"; #1.1
+ $hdr{connection} = ($persistent ? $keepalive ? "keep-alive, " : "" :
"close, ") . "Te"; #1.1
$hdr{te} = "trailers" unless exists $hdr{te}; #1.1
my %state = (connect_guard => 1);
@@ -805,10 +848,10 @@
"$method $rpath HTTP/1.1\015\012"
. (join "", map "\u$_: $hdr{$_}\015\012", grep defined $hdr{$_}, keys
%hdr)
. "\015\012"
- . (delete $arg{body})
+ . $arg{body}
);
- # return if error occured during push_write()
+ # return if error occurred during push_write()
return unless %state;
# reduce memory usage, save a kitten, also re-use it for the response
headers.
@@ -845,19 +888,42 @@
}
# redirect handling
- # microsoft and other shitheads don't give a shit for following
standards,
- # try to support some common forms of broken Location headers.
- if ($hdr{location} !~ /^(?: $ | [^:\/?\#]+ : )/x) {
- $hdr{location} =~ s/^\.\/+//;
-
- my $url = "$rscheme://$uhost:$uport";
-
- unless ($hdr{location} =~ s/^\///) {
- $url .= $upath;
- $url =~ s/\/[^\/]*$//;
+ # relative uri handling forced by microsoft and other shitheads.
+ # we give our best and fall back to URI if available.
+ if (exists $hdr{location}) {
+ my $loc = $hdr{location};
+
+ if ($loc =~ m%^//%) { # //
+ $loc = "$rscheme:$loc";
+
+ } elsif ($loc eq "") {
+ $loc = $url;
+
+ } elsif ($loc !~ /^(?: $ | [^:\/?\#]+ : )/x) { # anything "simple"
+ $loc =~ s/^\.\/+//;
+
+ if ($loc !~ m%^[.?#]%) {
+ my $prefix = "$rscheme://$uhost:$uport";
+
+ unless ($loc =~ s/^\///) {
+ $prefix .= $upath;
+ $prefix =~ s/\/[^\/]*$//;
+ }
+
+ $loc = "$prefix/$loc";
+
+ } elsif (eval { require URI }) { # uri
+ $loc = URI->new_abs ($loc, $url)->as_string;
+
+ } else {
+ return _error %state, $cb, { @pseudo, Status => 599, Reason
=> "Cannot parse Location (URI module missing)" };
+ #$hdr{Status} = 599;
+ #$hdr{Reason} = "Unparsable Redirect (URI module missing)";
+ #$recurse = 0;
+ }
}
- $hdr{location} = "$url/$hdr{location}";
+ $hdr{location} = $loc;
}
my $redirect;
@@ -869,12 +935,13 @@
# 301, 302 and 303, in contrast to HTTP/1.0 and 1.1.
# also, the UA should ask the user for 301 and 307 and POST,
# industry standard seems to be to simply follow.
- # we go with the industry standard.
+ # we go with the industry standard. 308 is defined
+ # by rfc7238
if ($status == 301 or $status == 302 or $status == 303) {
# HTTP/1.1 is unclear on how to mutate the method
$method = "GET" unless $method eq "HEAD";
$redirect = 1;
- } elsif ($status == 307) {
+ } elsif ($status == 307 or $status == 308) {
$redirect = 1;
}
}
@@ -1196,7 +1263,7 @@
To clear an already-set proxy, use C<undef>.
-When AnyEvent::HTTP is laoded for the first time it will query the
+When AnyEvent::HTTP is loaded for the first time it will query the
default proxy from the operating system, currently by looking at
C<$ENV{http_proxy>}.
@@ -1208,7 +1275,7 @@
You should call this function (with a true C<$session_end>) before you
save cookies to disk, and you should call this function after loading them
-again. If you have a long-running program you can additonally call this
+again. If you have a long-running program you can additionally call this
function from time to time.
A cookie jar is initially an empty hash-reference that is managed by this
@@ -1218,11 +1285,12 @@
emptied. All other keys are hostnames or IP addresses pointing to
hash-references. The key for these inner hash references is the
server path for which this cookie is meant, and the values are again
-hash-references. The keys of those hash-references is the cookie name, and
+hash-references. Each key of those hash-references is a cookie name, and
the value, you guessed it, is another hash-reference, this time with the
key-value pairs from the cookie, except for C<expires> and C<max-age>,
which have been replaced by a C<_expires> key that contains the cookie
-expiry timestamp.
+expiry timestamp. Session cookies are indicated by not having an
+C<_expires> key.
Here is an example of a cookie jar with a single cookie, so you have a
chance of understanding the above paragraph:
@@ -1274,13 +1342,13 @@
increase it much.
For comparison: the RFC's recommend 4 non-persistent or 2 persistent
-connections, older browsers used 2, newers (such as firefox 3) typically
-use 6, and Opera uses 8 because like, they have the fastest browser and
-give a shit for everybody else on the planet.
+connections, older browsers used 2, newer ones (such as firefox 3)
+typically use 6, and Opera uses 8 because like, they have the fastest
+browser and give a shit for everybody else on the planet.
=item $AnyEvent::HTTP::PERSISTENT_TIMEOUT
-The time after which idle persistent conenctions get closed by
+The time after which idle persistent connections get closed by
AnyEvent::HTTP (default: C<3>).
=item $AnyEvent::HTTP::ACTIVE
@@ -1355,7 +1423,7 @@
=head2 SHOWCASE
-This section contaisn some more elaborate "real-world" examples or code
+This section contains some more elaborate "real-world" examples or code
snippets.
=head2 HTTP/1.1 FILE DOWNLOAD
@@ -1369,7 +1437,7 @@
on older servers.
It calls the completion callback with either C<undef>, which means a
-nonretryable error occured, C<0> when the download was partial and should
+nonretryable error occurred, C<0> when the download was partial and should
be retried, and C<1> if it was successful.
use AnyEvent::HTTP;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AnyEvent-HTTP-2.15/META.json
new/AnyEvent-HTTP-2.21/META.json
--- old/AnyEvent-HTTP-2.15/META.json 2012-11-14 23:22:15.000000000 +0100
+++ new/AnyEvent-HTTP-2.21/META.json 2014-06-09 01:36:26.000000000 +0200
@@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter
version 2.112150",
+ "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter
version 2.140640",
"license" : [
"unknown"
],
@@ -22,15 +22,18 @@
"prereqs" : {
"build" : {
"requires" : {
- "ExtUtils::MakeMaker" : 0
+ "ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : 0
+ "ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
+ "recommends" : {
+ "URI" : "0"
+ },
"requires" : {
"AnyEvent" : "5.33",
"common::sense" : "3.3"
@@ -38,5 +41,5 @@
}
},
"release_status" : "stable",
- "version" : "2.15"
+ "version" : 2.21
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AnyEvent-HTTP-2.15/META.yml
new/AnyEvent-HTTP-2.21/META.yml
--- old/AnyEvent-HTTP-2.15/META.yml 2012-11-14 23:22:15.000000000 +0100
+++ new/AnyEvent-HTTP-2.21/META.yml 2014-06-09 01:36:26.000000000 +0200
@@ -3,21 +3,23 @@
author:
- unknown
build_requires:
- ExtUtils::MakeMaker: 0
+ ExtUtils::MakeMaker: '0'
configure_requires:
- ExtUtils::MakeMaker: 0
+ ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version
2.112150'
+generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version
2.140640'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: AnyEvent-HTTP
no_index:
directory:
- t
- inc
+recommends:
+ URI: '0'
requires:
- AnyEvent: 5.33
- common::sense: 3.3
-version: 2.15
+ AnyEvent: '5.33'
+ common::sense: '3.3'
+version: 2.21
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AnyEvent-HTTP-2.15/Makefile.PL
new/AnyEvent-HTTP-2.21/Makefile.PL
--- old/AnyEvent-HTTP-2.15/Makefile.PL 2011-06-14 07:20:04.000000000 +0200
+++ new/AnyEvent-HTTP-2.21/Makefile.PL 2014-06-09 01:28:48.000000000 +0200
@@ -12,6 +12,11 @@
AnyEvent => 5.33,
common::sense => 3.3,
},
+ META_MERGE => {
+ recommends => {
+ URI => 0,
+ },
+ },
});
$mm->flush;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AnyEvent-HTTP-2.15/README
new/AnyEvent-HTTP-2.21/README
--- old/AnyEvent-HTTP-2.15/README 2012-11-14 23:22:15.000000000 +0100
+++ new/AnyEvent-HTTP-2.21/README 2014-06-09 01:36:26.000000000 +0200
@@ -52,7 +52,7 @@
cancelled.
The callback will be called with the response body data as first
- argument (or "undef" if an error occured), and a hash-ref with
+ argument (or "undef" if an error occurred), and a hash-ref with
response headers (and trailers) as second argument.
All the headers in that hash are lowercased. In addition to the
@@ -84,7 +84,7 @@
590-599 and the "Reason" pseudo-header will contain an error
message. Currently the following status codes are used:
- 595 - errors during connection etsbalishment, proxy handshake.
+ 595 - errors during connection establishment, proxy handshake.
596 - errors during TLS negotiation, request sending and header
processing.
597 - errors during body receiving or processing.
@@ -111,6 +111,12 @@
authentication and other retries and so on, and how often to do
so.
+ Only redirects to http and https URLs are supported. While most
+ common redirection forms are handled entirely within this
+ module, some require the use of the optional URI module. If it
+ is required but missing, then the request will fail with an
+ error.
+
headers => hashref
The request headers to use. Currently, "http_request" may
provide its own "Host:", "Content-Length:", "Connection:" and
@@ -191,7 +197,7 @@
on_prepare => $callback->($fh)
In rare cases you need to "tune" the socket before it is used to
- connect (for exmaple, to bind it on a given IP address). This
+ connect (for example, to bind it on a given IP address). This
parameter overrides the prepare callback passed to
"AnyEvent::Socket::tcp_connect" and behaves exactly the same way
(e.g. it has to provide a timeout). See the description for the
@@ -374,7 +380,7 @@
To clear an already-set proxy, use "undef".
- When AnyEvent::HTTP is laoded for the first time it will query the
+ When AnyEvent::HTTP is loaded for the first time it will query the
default proxy from the operating system, currently by looking at
"$ENV{http_proxy"}.
@@ -386,7 +392,7 @@
You should call this function (with a true $session_end) before you
save cookies to disk, and you should call this function after
loading them again. If you have a long-running program you can
- additonally call this function from time to time.
+ additionally call this function from time to time.
A cookie jar is initially an empty hash-reference that is managed by
this module. It's format is subject to change, but currently it is
@@ -396,11 +402,12 @@
All other keys are hostnames or IP addresses pointing to
hash-references. The key for these inner hash references is the
server path for which this cookie is meant, and the values are again
- hash-references. The keys of those hash-references is the cookie
- name, and the value, you guessed it, is another hash-reference, this
- time with the key-value pairs from the cookie, except for "expires"
- and "max-age", which have been replaced by a "_expires" key that
- contains the cookie expiry timestamp.
+ hash-references. Each key of those hash-references is a cookie name,
+ and the value, you guessed it, is another hash-reference, this time
+ with the key-value pairs from the cookie, except for "expires" and
+ "max-age", which have been replaced by a "_expires" key that
+ contains the cookie expiry timestamp. Session cookies are indicated
+ by not having an "_expires" key.
Here is an example of a cookie jar with a single cookie, so you have
a chance of understanding the above paragraph:
@@ -449,12 +456,12 @@
increase it much.
For comparison: the RFC's recommend 4 non-persistent or 2 persistent
- connections, older browsers used 2, newers (such as firefox 3)
+ connections, older browsers used 2, newer ones (such as firefox 3)
typically use 6, and Opera uses 8 because like, they have the
fastest browser and give a shit for everybody else on the planet.
$AnyEvent::HTTP::PERSISTENT_TIMEOUT
- The time after which idle persistent conenctions get closed by
+ The time after which idle persistent connections get closed by
AnyEvent::HTTP (default: 3).
$AnyEvent::HTTP::ACTIVE
@@ -464,7 +471,7 @@
load-leveling.
SHOWCASE
- This section contaisn some more elaborate "real-world" examples or code
+ This section contains some more elaborate "real-world" examples or code
snippets.
HTTP/1.1 FILE DOWNLOAD
@@ -477,7 +484,7 @@
re-download on older servers.
It calls the completion callback with either "undef", which means a
- nonretryable error occured, 0 when the download was partial and should
+ nonretryable error occurred, 0 when the download was partial and should
be retried, and 1 if it was successful.
use AnyEvent::HTTP;
@@ -625,6 +632,6 @@
Marc Lehmann <[email protected]>
http://home.schmorp.de/
- With many thanks to Дмитрий Шалашов, who provided
- countless testcases and bugreports.
+ With many thanks to Дмитрий Шалашов, who provided countless testcases
+ and bugreports.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]