diff -Nru libanyevent-http-perl-2.23/Changes libanyevent-http-perl-2.24/Changes --- libanyevent-http-perl-2.23/Changes 2016-08-28 09:30:38.000000000 +0000 +++ libanyevent-http-perl-2.24/Changes 2018-08-30 01:23:10.000000000 +0000 @@ -3,15 +3,32 @@ TODO: provide lwp_request function that takes an lwp http requets and returns a http response. TODO: set_proxy hook TODO: use proxy hook -TODO: maybe read big chunks in smaller portions for chunked-encoding + on_body. TODO: on_upgrade, for 101 responses? TODO: document session vs. sessionid correctly. TODO: support proxy username:password in both proxy switch and set_proxy string (dzagashev@gmail.com) TODO: remove "unexpectedly got a destructed handle" +TODO: maybe read big chunks in smaller portions for chunked-encoding + on_body. TODO: callback as body (Kostirya) TODO: infinite recursion(?) (Kostirya) TODO: default rbuf_max value maybe? how about reading large chunks in small parts? +TODO: servers send empty reason, which then gets mangled with linear whitespace CRLF - maybe workaround? + +TODO: look into http 0.9 support (Kostirya ) +TODO: http://appft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&%23038;d=PG01&%23038;p=1&%23038;u=/netahtml/PTO/srchnum.html&%23038;r=1&%23038;f=G&%23038;l=50&%23038;s1="20110298798".PGNR.&%23038;OS=DN/20110298798&%23038;RS=DN/20110298798 + +2.24 Thu Aug 30 03:23:03 CEST 2018 + - bring cookie management more in line with RFC 6265; implement idn + matching for cookie domains. + - update cookie_jar version to 2, invalidate existing cookie jars. + - preserve original cookie domain attribute. + - also expire old cookie jars in cookie parser, just in case. + - further improve relative redirection code. + - comment out code that tried to detect possible bugs with persistent + connection caching, but since it never triggered, it's probably + working fine :) + - do not call on_body callback on a response that AE::HTTP will recurse + on internally (reported by Антон Онуфриев and Ruslan Zakirov). 2.23 Sun Aug 28 11:30:33 CEST 2016 - relative redirects used the proxy schema instead of the request diff -Nru libanyevent-http-perl-2.23/debian/changelog libanyevent-http-perl-2.24/debian/changelog --- libanyevent-http-perl-2.23/debian/changelog 2016-10-04 11:35:49.000000000 +0000 +++ libanyevent-http-perl-2.24/debian/changelog 2018-09-02 10:31:43.000000000 +0000 @@ -1,3 +1,17 @@ +libanyevent-http-perl (2.24-1) unstable; urgency=medium + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ Xavier Guimard ] + * Import upstream version 2.24 + * Declare compliance with policy 4.2.1 + * Bump debhelper compat to 10 + * Update my id + * Add Berne Convention comment + + -- Xavier Guimard Sun, 02 Sep 2018 12:31:43 +0200 + libanyevent-http-perl (2.23-1) unstable; urgency=medium * Team upload. diff -Nru libanyevent-http-perl-2.23/debian/compat libanyevent-http-perl-2.24/debian/compat --- libanyevent-http-perl-2.23/debian/compat 2016-10-04 11:35:49.000000000 +0000 +++ libanyevent-http-perl-2.24/debian/compat 2018-09-02 10:23:33.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru libanyevent-http-perl-2.23/debian/control libanyevent-http-perl-2.24/debian/control --- libanyevent-http-perl-2.23/debian/control 2016-10-04 11:35:49.000000000 +0000 +++ libanyevent-http-perl-2.24/debian/control 2018-09-02 10:26:34.000000000 +0000 @@ -1,16 +1,16 @@ Source: libanyevent-http-perl Maintainer: Debian Perl Group -Uploaders: Xavier Guimard +Uploaders: Xavier Guimard Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 9) +Build-Depends: debhelper (>= 10) Build-Depends-Indep: libanyevent-perl, libcommon-sense-perl, perl -Standards-Version: 3.9.8 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libanyevent-http-perl.git -Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libanyevent-http-perl.git +Standards-Version: 4.2.1 +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libanyevent-http-perl +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libanyevent-http-perl.git Homepage: https://metacpan.org/release/AnyEvent-HTTP Package: libanyevent-http-perl diff -Nru libanyevent-http-perl-2.23/debian/copyright libanyevent-http-perl-2.24/debian/copyright --- libanyevent-http-perl-2.23/debian/copyright 2016-10-04 11:35:49.000000000 +0000 +++ libanyevent-http-perl-2.24/debian/copyright 2018-09-02 10:29:30.000000000 +0000 @@ -9,13 +9,17 @@ Comment: This copyright attribution is based upon a personal email from Marc Lehmann. + The upstream distribution does not contain an explicit statement of + copyright ownership. Pursuant to the Berne Convention for the Protection of + Literary and Artistic Works, it is assumed that all content is copyright by + its respective authors unless otherwise stated. Files: debian/* Copyright: 2010, Jonathan Yu 2011, Maximilian Gass 2011, Nicholas Bamber 2012, Salvatore Bonaccorso - 2012, Xavier Guimard + 2012-2018, Xavier Guimard License: Artistic or GPL-1+ License: Artistic diff -Nru libanyevent-http-perl-2.23/HTTP.pm libanyevent-http-perl-2.24/HTTP.pm --- libanyevent-http-perl-2.23/HTTP.pm 2016-08-28 09:31:17.000000000 +0000 +++ libanyevent-http-perl-2.24/HTTP.pm 2018-08-30 01:20:03.000000000 +0000 @@ -48,7 +48,7 @@ use base Exporter::; -our $VERSION = 2.23; +our $VERSION = 2.24; our @EXPORT = qw(http_get http_post http_head http_request); @@ -456,7 +456,7 @@ sub cookie_jar_expire($;$) { my ($jar, $session_end) = @_; - %$jar = () if $jar->{version} != 1; + %$jar = () if $jar->{version} != 2; my $anow = AE::now; @@ -486,20 +486,19 @@ sub cookie_jar_extract($$$$) { my ($jar, $scheme, $host, $path) = @_; - %$jar = () if $jar->{version} != 1; + %$jar = () if $jar->{version} != 2; + + $host = AnyEvent::Util::idn_to_ascii $host + if $host =~ /[^\x00-\x7f]/; my @cookies; while (my ($chost, $paths) = each %$jar) { next unless ref $paths; - if ($chost =~ /^\./) { - next unless $chost eq substr $host, -length $chost; - } elsif ($chost =~ /\./) { - next unless $chost eq $host; - } else { - next; - } + # exact match or suffix including . match + $chost eq $host or ".$chost" eq substr $host, -1 - length $chost + or next; while (my ($cpath, $cookies) = each %$paths) { next unless $cpath eq substr $path, 0, length $cpath; @@ -531,6 +530,8 @@ sub cookie_jar_set_cookie($$$$) { my ($jar, $set_cookie, $host, $date) = @_; + %$jar = () if $jar->{version} != 2; + my $anow = int AE::now; my $snow; # server-now @@ -585,7 +586,7 @@ my $cpath = (delete $kv{path}) || "/"; if (exists $kv{domain}) { - $cdom = delete $kv{domain}; + $cdom = $kv{domain}; $cdom =~ s/^\.?/./; # make sure it starts with a "." @@ -594,12 +595,14 @@ # this is not rfc-like and not netscape-like. go figure. my $ndots = $cdom =~ y/.//; next if $ndots < ($cdom =~ /\.[^.][^.]\.[^.][^.]$/ ? 3 : 2); + + $cdom = substr $cdom, 1; # remove initial . } else { $cdom = $host; } # store it - $jar->{version} = 1; + $jar->{version} = 2; $jar->{lc $cdom}{$cpath}{$name} = \%kv; redo if /\G\s*,/gc; @@ -906,7 +909,7 @@ $loc =~ s/^\.\/+//; if ($loc !~ m%^[.?#]%) { - my $prefix = "$uscheme://$uhost:$uport"; + my $prefix = "$uscheme://$uauthority"; unless ($loc =~ s/^\///) { $prefix .= $upath; @@ -1033,7 +1036,7 @@ } elsif ($chunked) { my $cl = 0; my $body = ""; - my $on_body = $arg{on_body} || sub { $body .= shift; 1 }; + my $on_body = (!$redirect && $arg{on_body}) || sub { $body .= shift; 1 }; $state{read_chunk} = sub { $_[1] =~ /^([0-9a-fA-F]+)/ @@ -1076,7 +1079,7 @@ $_[0]->push_read (line => $state{read_chunk}); - } elsif ($arg{on_body}) { + } elsif (!$redirect && $arg{on_body}) { if (defined $len) { $_[0]->on_read (sub { $len -= length $_[0]{rbuf}; @@ -1219,11 +1222,11 @@ $was_persistent = 1; $state{handle} = ka_fetch $ka_key; - $state{handle}->destroyed - and die "AnyEvent::HTTP: unexpectedly got a destructed handle (1), please report.";#d# +# $state{handle}->destroyed +# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (1), please report.";#d# $prepare_handle->(); - $state{handle}->destroyed - and die "AnyEvent::HTTP: unexpectedly got a destructed handle (2), please report.";#d# +# $state{handle}->destroyed +# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (2), please report.";#d# $handle_actual_request->(); } else { diff -Nru libanyevent-http-perl-2.23/META.json libanyevent-http-perl-2.24/META.json --- libanyevent-http-perl-2.23/META.json 2016-08-28 09:31:22.000000000 +0000 +++ libanyevent-http-perl-2.24/META.json 2018-08-30 01:23:15.000000000 +0000 @@ -4,7 +4,7 @@ "unknown" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001", + "generated_by" : "ExtUtils::MakeMaker version 7.32, CPAN::Meta::Converter version 2.150010", "license" : [ "unknown" ], @@ -41,5 +41,6 @@ } }, "release_status" : "stable", - "version" : 2.23 + "version" : 2.24, + "x_serialization_backend" : "JSON::PP version 2.27300" } diff -Nru libanyevent-http-perl-2.23/META.yml libanyevent-http-perl-2.24/META.yml --- libanyevent-http-perl-2.23/META.yml 2016-08-28 09:31:22.000000000 +0000 +++ libanyevent-http-perl-2.24/META.yml 2018-08-30 01:23:15.000000000 +0000 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001' +generated_by: 'ExtUtils::MakeMaker version 7.32, CPAN::Meta::Converter version 2.150010' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -22,4 +22,5 @@ requires: AnyEvent: '5.33' common::sense: '3.3' -version: 2.23 +version: 2.24 +x_serialization_backend: 'CPAN::Meta::YAML version 0.012'