Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-HTTP-Tiny for openSUSE:Factory checked in at 2021-08-10 10:27:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-HTTP-Tiny (Old) and /work/SRC/openSUSE:Factory/.perl-HTTP-Tiny.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-HTTP-Tiny" Tue Aug 10 10:27:46 2021 rev:14 rq:911143 version:0.078 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-HTTP-Tiny/perl-HTTP-Tiny.changes 2018-08-31 10:44:39.283217646 +0200 +++ /work/SRC/openSUSE:Factory/.perl-HTTP-Tiny.new.1899/perl-HTTP-Tiny.changes 2021-08-10 10:28:28.349722801 +0200 @@ -1,0 +2,28 @@ +Tue Aug 3 03:06:40 UTC 2021 - Tina M??ller <timueller+p...@suse.de> + +- updated to 0.078 + see /usr/share/doc/packages/perl-HTTP-Tiny/Changes + + 0.078 2021-08-02 09:24:03-04:00 America/New_York + - No changes from 0.077-TRIAL. + 0.077 2021-07-22 13:07:14-04:00 America/New_York (TRIAL RELEASE) + [ADDED] + - Added a `patch` helper method for the HTTP `PATCH` verb. + - If the REQUEST_METHOD environment variable is set, then CGI_HTTP_PROXY + replaces HTTP_PROXY. + [FIXED] + - Unsupported scheme errors early without giving an uninitialized value + warning first. + - Sends Content-Length: 0 on empty body PUT/POST. This is not in the spec, + but some servers require this. + - Allows optional status line reason, as clarified in RFC 7230. + - Ignore SIGPIPE on reads as well as writes, as IO::Socket::SSL says that + SSL reads can also send writes as a side effect. + - Check if a server has closed a connection before preserving it for reuse. + [DOCS] + - Clarified that exceptions/errors result in 599 status codes. + [PREREQS] + - Optional IO::Socket::IP prereq must be at least version 0.32 to be used. + This ensures correct timeout support. + +------------------------------------------------------------------- Old: ---- HTTP-Tiny-0.076.tar.gz New: ---- HTTP-Tiny-0.078.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-HTTP-Tiny.spec ++++++ --- /var/tmp/diff_new_pack.hGPTHW/_old 2021-08-10 10:28:28.801721642 +0200 +++ /var/tmp/diff_new_pack.hGPTHW/_new 2021-08-10 10:28:28.805721632 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-HTTP-Tiny # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,22 +12,20 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # +%define cpan_name HTTP-Tiny Name: perl-HTTP-Tiny -Version: 0.076 +Version: 0.078 Release: 0 -%define cpan_name HTTP-Tiny -Summary: Small, Simple, Correct Http/1.1 Client +Summary: Small, simple, correct HTTP/1.1 client License: Artistic-1.0 OR GPL-1.0-or-later -Group: Development/Libraries/Perl -Url: http://search.cpan.org/dist/HTTP-Tiny/ +URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(IPC::Cmd) @@ -52,15 +50,15 @@ Cookie support requires HTTP::CookieJar or an equivalent class. %prep -%setup -q -n %{cpan_name}-%{version} -find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644 +%autosetup -n %{cpan_name}-%{version} +find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build -%{__perl} Makefile.PL INSTALLDIRS=vendor -%{__make} %{?_smp_mflags} +perl Makefile.PL INSTALLDIRS=vendor +%make_build %check -%{__make} test +make test %install %perl_make_install @@ -68,7 +66,6 @@ %perl_gen_filelist %files -f %{name}.files -%defattr(-,root,root,755) %doc Changes CONTRIBUTING.mkdn README %license LICENSE ++++++ HTTP-Tiny-0.076.tar.gz -> HTTP-Tiny-0.078.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/Changes new/HTTP-Tiny-0.078/Changes --- old/HTTP-Tiny-0.076/Changes 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/Changes 2021-08-02 15:24:17.000000000 +0200 @@ -1,5 +1,42 @@ Release notes for HTTP-Tiny +0.078 2021-08-02 09:24:03-04:00 America/New_York + + - No changes from 0.077-TRIAL. + +0.077 2021-07-22 13:07:14-04:00 America/New_York (TRIAL RELEASE) + + [ADDED] + + - Added a `patch` helper method for the HTTP `PATCH` verb. + + - If the REQUEST_METHOD environment variable is set, then CGI_HTTP_PROXY + replaces HTTP_PROXY. + + [FIXED] + + - Unsupported scheme errors early without giving an uninitialized value + warning first. + + - Sends Content-Length: 0 on empty body PUT/POST. This is not in the spec, + but some servers require this. + + - Allows optional status line reason, as clarified in RFC 7230. + + - Ignore SIGPIPE on reads as well as writes, as IO::Socket::SSL says that + SSL reads can also send writes as a side effect. + + - Check if a server has closed a connection before preserving it for reuse. + + [DOCS] + + - Clarified that exceptions/errors result in 599 status codes. + + [PREREQS] + + - Optional IO::Socket::IP prereq must be at least version 0.32 to be used. + This ensures correct timeout support. + 0.076 2018-08-05 21:07:38-04:00 America/New_York - No changes from 0.075-TRIAL. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/LICENSE new/HTTP-Tiny-0.078/LICENSE --- old/HTTP-Tiny-0.076/LICENSE 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/LICENSE 2021-08-02 15:24:17.000000000 +0200 @@ -1,4 +1,4 @@ -This software is copyright (c) 2018 by Christian Hansen. +This software is copyright (c) 2021 by Christian Hansen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2018 by Christian Hansen. +This software is Copyright (c) 2021 by Christian Hansen. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2018 by Christian Hansen. +This software is Copyright (c) 2021 by Christian Hansen. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/MANIFEST new/HTTP-Tiny-0.078/MANIFEST --- old/HTTP-Tiny-0.076/MANIFEST 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/MANIFEST 2021-08-02 15:24:17.000000000 +0200 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.023. CONTRIBUTING.mkdn Changes LICENSE @@ -47,6 +47,7 @@ corpus/get-20.txt corpus/get-21.txt corpus/get-22.txt +corpus/get-23.txt corpus/head-01.txt corpus/keepalive-01.txt corpus/keepalive-02.txt @@ -59,12 +60,16 @@ corpus/mirror-04.txt corpus/mirror-05.txt corpus/post-01.txt +corpus/post-02.txt corpus/proxy-auth-01.txt corpus/put-01.txt corpus/put-02.txt corpus/put-03.txt corpus/put-04.txt corpus/put-05.txt +corpus/put-06.txt +corpus/put-07.txt +corpus/put-08.txt corpus/redirect-01.txt corpus/redirect-02.txt corpus/redirect-03.txt @@ -118,10 +123,10 @@ t/Util.pm xt/author/00-compile.t xt/author/critic.t +xt/author/distmeta.t xt/author/minimum-version.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/author/test-version.t -xt/release/distmeta.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/META.json new/HTTP-Tiny-0.078/META.json --- old/HTTP-Tiny-0.076/META.json 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/META.json 2021-08-02 15:24:17.000000000 +0200 @@ -5,7 +5,7 @@ "David Golden <dagol...@cpan.org>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", + "generated_by" : "Dist::Zilla version 6.023, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -111,7 +111,7 @@ "provides" : { "HTTP::Tiny" : { "file" : "lib/HTTP/Tiny.pm", - "version" : "0.076" + "version" : "0.078" } }, "release_status" : "stable", @@ -126,7 +126,7 @@ "web" : "https://github.com/chansen/p5-http-tiny" } }, - "version" : "0.076", + "version" : "0.078", "x_authority" : "cpan:DAGOLDEN", "x_contributors" : [ "Alan Gardner <gard...@pythian.com>", @@ -145,6 +145,8 @@ "Dean Pearce <pea...@pythian.com>", "Edward Zborowski <e...@rubensteintech.com>", "Felipe Gasper <fel...@felipegasper.com>", + "Greg Kennedy <kennedy.g...@gmail.com>", + "James E Keenan <jkee...@cpan.org>", "James Raspass <jrasp...@gmail.com>", "Jeremy Mates <jma...@cpan.org>", "Jess Robinson <casta...@desert-island.me.uk>", @@ -152,11 +154,14 @@ "Lukas Eklund <lekl...@gmail.com>", "Martin J. Evans <mj...@ntlworld.com>", "Martin-Louis Bright <mlbri...@gmail.com>", + "Matthew Horsfall <wolfs...@gmail.com>", + "Michael R. Davis <mrdv...@users.noreply.github.com>", "Mike Doherty <dohe...@cpan.org>", "Nicolas Rochelemagne <rochelema...@cpanel.net>", "Olaf Alders <o...@wundersolutions.com>", "Olivier Mengu\u00e9 <dol...@cpan.org>", "Petr P\u00edsa\u0159 <ppi...@redhat.com>", + "sanjay-cpu <snjkm...@gmail.com>", "Serguei Trouchelle <s...@cpan.org>", "Shoichi Kaji <sk...@cpan.org>", "SkyMarshal <skymarshal1...@gmail.com>", @@ -165,9 +170,11 @@ "Syohei YOSHIDA <syo...@gmail.com>", "Tatsuhiko Miyagawa <miyag...@bulknews.net>", "Tom Hukins <t...@eborcom.com>", - "Tony Cook <t...@develop-help.com>" + "Tony Cook <t...@develop-help.com>", + "Xavier Guimard <y...@debian.org>" ], - "x_generated_by_perl" : "v5.28.0", - "x_serialization_backend" : "Cpanel::JSON::XS version 4.04" + "x_generated_by_perl" : "v5.34.0", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.26", + "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/META.yml new/HTTP-Tiny-0.078/META.yml --- old/HTTP-Tiny-0.076/META.yml 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/META.yml 2021-08-02 15:24:17.000000000 +0200 @@ -22,7 +22,7 @@ ExtUtils::MakeMaker: '6.17' perl: '5.006' dynamic_config: 0 -generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' +generated_by: 'Dist::Zilla version 6.023, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -39,7 +39,7 @@ provides: HTTP::Tiny: file: lib/HTTP/Tiny.pm - version: '0.076' + version: '0.078' recommends: HTTP::CookieJar: '0.001' IO::Socket::IP: '0.32' @@ -61,7 +61,7 @@ bugtracker: https://github.com/chansen/p5-http-tiny/issues homepage: https://github.com/chansen/p5-http-tiny repository: https://github.com/chansen/p5-http-tiny.git -version: '0.076' +version: '0.078' x_authority: cpan:DAGOLDEN x_contributors: - 'Alan Gardner <gard...@pythian.com>' @@ -80,6 +80,8 @@ - 'Dean Pearce <pea...@pythian.com>' - 'Edward Zborowski <e...@rubensteintech.com>' - 'Felipe Gasper <fel...@felipegasper.com>' + - 'Greg Kennedy <kennedy.g...@gmail.com>' + - 'James E Keenan <jkee...@cpan.org>' - 'James Raspass <jrasp...@gmail.com>' - 'Jeremy Mates <jma...@cpan.org>' - 'Jess Robinson <casta...@desert-island.me.uk>' @@ -87,11 +89,14 @@ - 'Lukas Eklund <lekl...@gmail.com>' - 'Martin J. Evans <mj...@ntlworld.com>' - 'Martin-Louis Bright <mlbri...@gmail.com>' + - 'Matthew Horsfall <wolfs...@gmail.com>' + - 'Michael R. Davis <mrdv...@users.noreply.github.com>' - 'Mike Doherty <dohe...@cpan.org>' - 'Nicolas Rochelemagne <rochelema...@cpanel.net>' - 'Olaf Alders <o...@wundersolutions.com>' - 'Olivier Mengu?? <dol...@cpan.org>' - 'Petr P??sa?? <ppi...@redhat.com>' + - 'sanjay-cpu <snjkm...@gmail.com>' - 'Serguei Trouchelle <s...@cpan.org>' - 'Shoichi Kaji <sk...@cpan.org>' - 'SkyMarshal <skymarshal1...@gmail.com>' @@ -101,5 +106,7 @@ - 'Tatsuhiko Miyagawa <miyag...@bulknews.net>' - 'Tom Hukins <t...@eborcom.com>' - 'Tony Cook <t...@develop-help.com>' -x_generated_by_perl: v5.28.0 + - 'Xavier Guimard <y...@debian.org>' +x_generated_by_perl: v5.34.0 x_serialization_backend: 'YAML::Tiny version 1.73' +x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/Makefile.PL new/HTTP-Tiny-0.078/Makefile.PL --- old/HTTP-Tiny-0.076/Makefile.PL 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/Makefile.PL 2021-08-02 15:24:17.000000000 +0200 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.023. use strict; use warnings; @@ -42,7 +42,7 @@ "lib" => 0, "open" => 0 }, - "VERSION" => "0.076", + "VERSION" => "0.078", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/README new/HTTP-Tiny-0.078/README --- old/HTTP-Tiny-0.076/README 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/README 2021-08-02 15:24:17.000000000 +0200 @@ -2,7 +2,7 @@ HTTP::Tiny - A small, simple, correct HTTP/1.1 client VERSION - version 0.076 + version 0.078 SYNOPSIS use HTTP::Tiny; @@ -59,8 +59,8 @@ * "max_redirect" ??? Maximum number of redirects allowed (defaults to 5) * "max_size" ??? Maximum response size in bytes (only when not using a - data callback). If defined, responses larger than this will return - an exception. + data callback). If defined, requests with responses larger than this + will return a 599 status code. * "http_proxy" ??? URL of a proxy server to use for HTTP connections (default is $ENV{http_proxy} ??? if set) @@ -76,8 +76,8 @@ $ENV{no_proxy} ???) * "timeout" ??? Request timeout in seconds (default is 60) If a socket - open, read or write takes longer than the timeout, an exception is - thrown. + open, read or write takes longer than the timeout, the request + response status code will be 599. * "verify_SSL" ??? A boolean that indicates whether to validate the SSL certificate of an "https" ??? connection (default is false) @@ -85,24 +85,26 @@ * "SSL_options" ??? A hashref of "SSL_*" ??? options to pass through to IO::Socket::SSL + An accessor/mutator method exists for each attribute. + Passing an explicit "undef" for "proxy", "http_proxy" or "https_proxy" will prevent getting the corresponding proxies from the environment. - Exceptions from "max_size", "timeout" or other errors will result in a - pseudo-HTTP status code of 599 and a reason of "Internal Exception". The - content field in the response will contain the text of the exception. + Errors during request execution will result in a pseudo-HTTP status code + of 599 and a reason of "Internal Exception". The content field in the + response will contain the text of the error. The "keep_alive" parameter enables a persistent connection, but only to - a single destination scheme, host and port. Also, if any - connection-relevant attributes are modified, or if the process ID or - thread ID change, the persistent connection will be dropped. If you want + a single destination scheme, host and port. If any connection-relevant + attributes are modified via accessor, or if the process ID or thread ID + change, the persistent connection will be dropped. If you want persistent connections across multiple destinations, use multiple HTTP::Tiny objects. See "SSL SUPPORT" for more on the "verify_SSL" and "SSL_options" attributes. - get|head|put|post|delete + get|head|put|post|patch|delete $response = $http->get($url); $response = $http->get($url, \%options); $response = $http->head($url); @@ -255,9 +257,8 @@ references from redirects in the same order that redirections occurred. If it does not exist, then no redirections occurred. - On an exception during the execution of the request, the "status" field - will contain 599, and the "content" field will contain the text of the - exception. + On an error during the execution of the request, the "status" field will + contain 599, and the "content" field will contain the text of the error. www_form_urlencode $params = $http->www_form_urlencode( $data ); @@ -302,9 +303,9 @@ SSL SUPPORT Direct "https" connections are supported only if IO::Socket::SSL 1.56 or - greater and Net::SSLeay 1.49 or greater are installed. An exception will - be thrown if new enough versions of these modules are not installed or - if the SSL encryption fails. You can also use "HTTP::Tiny::can_ssl()" + greater and Net::SSLeay 1.49 or greater are installed. An error will + occur if new enough versions of these modules are not installed or if + the SSL encryption fails. You can also use "HTTP::Tiny::can_ssl()" utility function that returns boolean to see if the required modules are installed. @@ -360,8 +361,8 @@ * /etc/ssl/ca-bundle.pem - An exception will be raised if "verify_SSL" is true and no CA - certificate file is available. + An error will be occur if "verify_SSL" is true and no CA certificate + file is available. If you desire complete control over SSL connections, the "SSL_options" attribute lets you provide a hash reference that will be passed through @@ -393,7 +394,8 @@ If the "REQUEST_METHOD" environment variable is set, then this might be a CGI process and "HTTP_PROXY" would be set from the "Proxy:" header, which is a security risk. If "REQUEST_METHOD" is set, "HTTP_PROXY" (the - upper case variant only) is ignored. + upper case variant only) is ignored, but "CGI_HTTP_PROXY" is considered + instead. Tunnelling "https" over an "http" proxy using the CONNECT method is supported. If your proxy uses "https" itself, you can not tunnel "https" @@ -427,7 +429,8 @@ It attempts to meet all "MUST" requirements of the specification, but does not implement all "SHOULD" requirements. (Note: it was developed against the earlier RFC 2616 specification and may not yet meet the - revised RFC 7230-7235 spec.) + revised RFC 7230-7235 spec.) Additionally, HTTP::Tiny supports the + "PATCH" method of RFC 5789. Some particular limitations of note include: @@ -536,6 +539,10 @@ * Felipe Gasper <fel...@felipegasper.com> + * Greg Kennedy <kennedy.g...@gmail.com> + + * James E Keenan <jkee...@cpan.org> + * James Raspass <jrasp...@gmail.com> * Jeremy Mates <jma...@cpan.org> @@ -550,6 +557,10 @@ * Martin-Louis Bright <mlbri...@gmail.com> + * Matthew Horsfall <wolfs...@gmail.com> + + * Michael R. Davis <mrdv...@users.noreply.github.com> + * Mike Doherty <dohe...@cpan.org> * Nicolas Rochelemagne <rochelema...@cpanel.net> @@ -560,6 +571,8 @@ * Petr P??sa?? <ppi...@redhat.com> + * sanjay-cpu <snjkm...@gmail.com> + * Serguei Trouchelle <s...@cpan.org> * Shoichi Kaji <sk...@cpan.org> @@ -578,8 +591,10 @@ * Tony Cook <t...@develop-help.com> + * Xavier Guimard <y...@debian.org> + COPYRIGHT AND LICENSE - This software is copyright (c) 2018 by Christian Hansen. + This software is copyright (c) 2021 by Christian Hansen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/form-01.txt new/HTTP-Tiny-0.078/corpus/form-01.txt --- old/HTTP-Tiny-0.076/corpus/form-01.txt 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/corpus/form-01.txt 2021-08-02 15:24:17.000000000 +0200 @@ -3,7 +3,7 @@ headers Content-Type: text/plain content - key|value|name|John Doe|noise|!@#$%^&*() + key|value|name|John Doe|undef|<undef>|noise|!@#$%^&*() datatype ARRAY ---------- @@ -12,9 +12,9 @@ Connection: close User-Agent: HTTP-Tiny/VERSION Content-Type: application/x-www-form-urlencoded -Content-Length: 60 +Content-Length: 67 -key=value&name=John+Doe&noise=%21%40%23%24%25%5E%26%2A%28%29 +key=value&name=John+Doe&undef=&noise=%21%40%23%24%25%5E%26%2A%28%29 ---------- HTTP/1.1 201 Created Date: Thu, 03 Feb 1994 00:00:00 GMT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/form-02.txt new/HTTP-Tiny-0.078/corpus/form-02.txt --- old/HTTP-Tiny-0.076/corpus/form-02.txt 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/corpus/form-02.txt 2021-08-02 15:24:17.000000000 +0200 @@ -1,7 +1,7 @@ url http://example.com/new content - key|value|name|John Doe|noise|!@#$%^&*() + key|value|name|John Doe|undef|<undef>|noise|!@#$%^&*() datatype HASH ---------- @@ -10,9 +10,9 @@ Connection: close User-Agent: HTTP-Tiny/VERSION Content-Type: application/x-www-form-urlencoded -Content-Length: 60 +Content-Length: 67 -key=value&name=John+Doe&noise=%21%40%23%24%25%5E%26%2A%28%29 +key=value&name=John+Doe&noise=%21%40%23%24%25%5E%26%2A%28%29&undef= ---------- HTTP/1.1 201 Created Date: Thu, 03 Feb 1994 00:00:00 GMT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/get-23.txt new/HTTP-Tiny-0.078/corpus/get-23.txt --- old/HTTP-Tiny-0.076/corpus/get-23.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/HTTP-Tiny-0.078/corpus/get-23.txt 2021-08-02 15:24:17.000000000 +0200 @@ -0,0 +1,17 @@ +url + http://example.com/index.html +expected + abcdefghijklmnopqrstuvwxyz1234567890abcdef +---------- +GET /index.html HTTP/1.1 +Host: example.com +Connection: close +User-Agent: HTTP-Tiny/VERSION + +---------- +HTTP/1.1 200 +Date: Thu, 03 Feb 1994 00:00:00 GMT +Content-Type: text/plain +Content-Length: 44 + +abcdefghijklmnopqrstuvwxyz1234567890abcdef diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/post-02.txt new/HTTP-Tiny-0.078/corpus/post-02.txt --- old/HTTP-Tiny-0.076/corpus/post-02.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/HTTP-Tiny-0.078/corpus/post-02.txt 2021-08-02 15:24:17.000000000 +0200 @@ -0,0 +1,20 @@ +url + http://example.com/index.html +headers + Content-Type: text/plain +content + +---------- +POST /index.html HTTP/1.1 +Host: example.com +Connection: close +User-Agent: HTTP-Tiny/VERSION +Content-Type: text/plain +Content-Length: 0 + +---------- +HTTP/1.1 200 OK +Date: Thu, 03 Feb 1994 00:00:00 GMT +Content-Type: text/plain +Content-Length: 0 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/put-06.txt new/HTTP-Tiny-0.078/corpus/put-06.txt --- old/HTTP-Tiny-0.076/corpus/put-06.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/HTTP-Tiny-0.078/corpus/put-06.txt 2021-08-02 15:24:17.000000000 +0200 @@ -0,0 +1,20 @@ +url + http://example.com/new.txt +headers + Content-Type: text/plain +content + +---------- +PUT /new.txt HTTP/1.1 +Host: example.com +Connection: close +User-Agent: HTTP-Tiny/VERSION +Content-Type: text/plain +Content-Length: 0 + +---------- +HTTP/1.1 201 Created +Date: Thu, 03 Feb 1994 00:00:00 GMT +Location: http://example.com/new.txt +Content-Length: 0 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/put-07.txt new/HTTP-Tiny-0.078/corpus/put-07.txt --- old/HTTP-Tiny-0.076/corpus/put-07.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/HTTP-Tiny-0.078/corpus/put-07.txt 2021-08-02 15:24:17.000000000 +0200 @@ -0,0 +1,22 @@ +url + http://example.com/callback.txt +headers + Content-Type: text/plain + Content-Length: 0 +content_cb + my @content = qq{}; + sub { shift @content } +---------- +PUT /callback.txt HTTP/1.1 +Host: example.com +Connection: close +User-Agent: HTTP-Tiny/VERSION +Content-Type: text/plain +Content-Length: 0 + +---------- +HTTP/1.1 201 Created +Date: Thu, 03 Feb 1994 00:00:00 GMT +Location: http://example.com/callback.txt +Content-Length: 0 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/put-08.txt new/HTTP-Tiny-0.078/corpus/put-08.txt --- old/HTTP-Tiny-0.076/corpus/put-08.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/HTTP-Tiny-0.078/corpus/put-08.txt 2021-08-02 15:24:17.000000000 +0200 @@ -0,0 +1,23 @@ +url + http://example.com/callback.txt +headers + Content-Type: text/plain +content_cb + my @content = qq{}; + sub { shift @content } +---------- +PUT /callback.txt HTTP/1.1 +Host: example.com +Connection: close +User-Agent: HTTP-Tiny/VERSION +Transfer-Encoding: chunked +Content-Type: text/plain + +0 + +---------- +HTTP/1.1 201 Created +Date: Thu, 03 Feb 1994 00:00:00 GMT +Location: http://example.com/callback.txt +Content-Length: 0 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/corpus/redirect-09.txt new/HTTP-Tiny-0.078/corpus/redirect-09.txt --- old/HTTP-Tiny-0.076/corpus/redirect-09.txt 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/corpus/redirect-09.txt 2021-08-02 15:24:17.000000000 +0200 @@ -10,6 +10,7 @@ POST /index.html HTTP/1.1 Host: example.com Connection: close +Content-Length: 0 User-Agent: HTTP-Tiny/VERSION ---------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/cpanfile new/HTTP-Tiny-0.078/cpanfile --- old/HTTP-Tiny-0.076/cpanfile 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/cpanfile 2021-08-02 15:24:17.000000000 +0200 @@ -1,3 +1,6 @@ +# This file is generated by Dist::Zilla::Plugin::CPANFile v6.023 +# Do not edit this file directly. To change prereqs, edit the `dist.ini` file. + requires "Carp" => "0"; requires "Fcntl" => "0"; requires "IO::Socket" => "0"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/lib/HTTP/Tiny.pm new/HTTP-Tiny-0.078/lib/HTTP/Tiny.pm --- old/HTTP-Tiny-0.076/lib/HTTP/Tiny.pm 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/lib/HTTP/Tiny.pm 2021-08-02 15:24:17.000000000 +0200 @@ -4,7 +4,7 @@ use warnings; # ABSTRACT: A small, simple, correct HTTP/1.1 client -our $VERSION = '0.076'; +our $VERSION = '0.078'; sub _croak { require Carp; Carp::croak(@_) } @@ -26,8 +26,8 @@ #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 callback). If defined, requests with responses larger than this will return +#pod a 599 status code. #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 @@ -38,23 +38,26 @@ #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 read or write takes longer than the timeout, the request response status code +#pod will be 599. #pod * C<verify_SSL> ??? A boolean that indicates whether to validate the SSL #pod certificate of an C<https> ??? connection (default is false) #pod * C<SSL_options> ??? A hashref of C<SSL_*> ??? options to pass through to #pod L<IO::Socket::SSL> #pod +#pod An accessor/mutator method exists for each attribute. +#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 Errors during request execution will result in a pseudo-HTTP status code of 599 +#pod and a reason of "Internal Exception". The content field in the response will +#pod contain the text of the error. #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 single destination scheme, host and port. If any connection-relevant +#pod attributes are modified via accessor, or if the process ID or thread ID change, +#pod the 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. @@ -152,7 +155,7 @@ # http proxy if (! exists $self->{http_proxy} ) { # under CGI, bypass HTTP_PROXY as request sets it from Proxy header - local $ENV{HTTP_PROXY} if $ENV{REQUEST_METHOD}; + local $ENV{HTTP_PROXY} = $ENV{CGI_HTTP_PROXY} if $ENV{REQUEST_METHOD}; $self->{http_proxy} = $ENV{http_proxy} || $ENV{HTTP_PROXY} || $self->{proxy}; } @@ -186,7 +189,7 @@ return; } -#pod =method get|head|put|post|delete +#pod =method get|head|put|post|patch|delete #pod #pod $response = $http->get($url); #pod $response = $http->get($url, \%options); @@ -200,7 +203,7 @@ #pod #pod =cut -for my $sub_name ( qw/get head put post delete/ ) { +for my $sub_name ( qw/get head put post patch delete/ ) { my $req_method = uc $sub_name; no strict 'refs'; eval <<"HERE"; ## no critic @@ -416,8 +419,8 @@ #pod redirects in the same order that redirections occurred. If it does #pod not exist, then no redirections occurred. #pod -#pod On an exception during the execution of the request, the C<status> field will -#pod contain 599, and the C<content> field will contain the text of the exception. +#pod On an error during the execution of the request, the C<status> field will +#pod contain 599, and the C<content> field will contain the text of the error. #pod #pod =cut @@ -434,7 +437,7 @@ for ( 0 .. 1 ) { $response = eval { $self->_request($method, $url, $args) }; last unless $@ && $idempotent{$method} - && $@ =~ m{^(?:Socket closed|Unexpected end)}; + && $@ =~ m{^(?:Socket closed|Unexpected end|SSL read error)}; } if (my $e = $@) { @@ -490,6 +493,8 @@ my @terms; while( @params ) { my ($key, $value) = splice(@params, 0, 2); + _croak("form data keys must not be undef") + if !defined($key); if ( ref $value eq 'ARRAY' ) { unshift @params, map { $key => $_ } @$value; } @@ -573,16 +578,8 @@ sub connected { my ($self) = @_; - # If a socket exists... - if ($self->{handle} && $self->{handle}{fh}) { - my $socket = $self->{handle}{fh}; - - # ...and is connected, return the peer host and port. - if ($socket->connected) { - return wantarray - ? ($socket->peerhost, $socket->peerport) - : join(':', $socket->peerhost, $socket->peerport); - } + if ( $self->{handle} ) { + return $self->{handle}->connected; } return; } @@ -599,7 +596,9 @@ sub _agent { my $class = ref($_[0]) || $_[0]; (my $default_agent = $class) =~ s{::}{-}g; - return $default_agent . "/" . $class->VERSION; + my $version = $class->VERSION; + $default_agent .= "/$version" if defined $version; + return $default_agent; } sub _request { @@ -607,6 +606,10 @@ my ($scheme, $host, $port, $path_query, $auth) = $self->_split_url($url); + if ($scheme ne 'http' && $scheme ne 'https') { + die(qq/Unsupported URL scheme '$scheme'\n/); + } + my $request = { method => $method, scheme => $scheme, @@ -659,6 +662,7 @@ } if ( $self->{keep_alive} + && $handle->connected && $known_message_length && $response->{protocol} eq 'HTTP/1.1' && ($response->{headers}{connection} || '') ne 'close' @@ -812,13 +816,25 @@ $request->{headers}{'connection'} = "close" unless $self->{keep_alive}; + # Some servers error on an empty-body PUT/POST without a content-length + if ( $request->{method} eq 'PUT' || $request->{method} eq 'POST' ) { + if (!defined($args->{content}) || !length($args->{content}) ) { + $request->{headers}{'content-length'} = 0; + } + } + if ( defined $args->{content} ) { - if (ref $args->{content} eq 'CODE') { - $request->{headers}{'content-type'} ||= "application/octet-stream"; - $request->{headers}{'transfer-encoding'} = 'chunked' - unless $request->{headers}{'content-length'} + if ( ref $args->{content} eq 'CODE' ) { + if ( exists $request->{'content-length'} && $request->{'content-length'} == 0 ) { + $request->{cb} = sub { "" }; + } + else { + $request->{headers}{'content-type'} ||= "application/octet-stream"; + $request->{headers}{'transfer-encoding'} = 'chunked' + unless exists $request->{headers}{'content-length'} || $request->{headers}{'transfer-encoding'}; - $request->{cb} = $args->{content}; + $request->{cb} = $args->{content}; + } } elsif ( length $args->{content} ) { my $content = $args->{content}; @@ -988,6 +1004,7 @@ sub _uri_escape { my ($self, $str) = @_; + return "" if !defined $str; if ( $] ge '5.008' ) { utf8::encode($str); } @@ -1014,7 +1031,7 @@ # not intended for general, per-client use and may be removed in the future my $SOCKET_CLASS = $ENV{PERL_HTTP_TINY_IPV4_ONLY} ? 'IO::Socket::INET' : - eval { require IO::Socket::IP; IO::Socket::IP->VERSION(0.25) } ? 'IO::Socket::IP' : + eval { require IO::Socket::IP; IO::Socket::IP->VERSION(0.32) } ? 'IO::Socket::IP' : 'IO::Socket::INET'; sub BUFSIZE () { 32768 } ## no critic @@ -1062,9 +1079,7 @@ if ( $scheme eq 'https' ) { $self->_assert_ssl; } - elsif ( $scheme ne 'http' ) { - die(qq/Unsupported URL scheme '$scheme'\n/); - } + $self->{fh} = $SOCKET_CLASS->new( PeerHost => $peer, PeerPort => $port, @@ -1097,6 +1112,16 @@ return $self; } +sub connected { + my ($self) = @_; + if ( $self->{fh} && $self->{fh}->connected ) { + return wantarray + ? ( $self->{fh}->peerhost, $self->{fh}->peerport ) + : join( ':', $self->{fh}->peerhost, $self->{fh}->peerport ); + } + return; +} + sub start_ssl { my ($self, $host) = @_; @@ -1186,6 +1211,11 @@ $len -= $take; } + # Ignore SIGPIPE because SSL reads can result in writes that might error. + # See "Expecting exactly the same behavior as plain sockets" in + # https://metacpan.org/dist/IO-Socket-SSL/view/lib/IO/Socket/SSL.pod#Common-Usage-Errors + local $SIG{PIPE} = 'IGNORE'; + while ($len > 0) { $self->can_read or die(q/Timed out while waiting for socket to become ready for reading/ . "\n"); @@ -1376,7 +1406,8 @@ sub write_body { @_ == 2 || die(q/Usage: $handle->write_body(request)/ . "\n"); my ($self, $request) = @_; - if ($request->{headers}{'content-length'}) { + if (exists $request->{headers}{'content-length'}) { + return unless $request->{headers}{'content-length'}; return $self->write_content_body($request); } else { @@ -1493,10 +1524,11 @@ my $line = $self->readline; - $line =~ /\A (HTTP\/(0*\d+\.0*\d+)) [\x09\x20]+ ([0-9]{3}) [\x09\x20]+ ([^\x0D\x0A]*) \x0D?\x0A/x + $line =~ /\A (HTTP\/(0*\d+\.0*\d+)) [\x09\x20]+ ([0-9]{3}) (?: [\x09\x20]+ ([^\x0D\x0A]*) )? \x0D?\x0A/x or die(q/Malformed Status-Line: / . $Printable->($line). "\n"); my ($protocol, $version, $status, $reason) = ($1, $2, $3, $4); + $reason = "" unless defined $reason; die (qq/Unsupported HTTP protocol: $protocol\n/) unless $version =~ /0*1\.0*[01]/; @@ -1672,7 +1704,7 @@ =head1 VERSION -version 0.076 +version 0.078 =head1 SYNOPSIS @@ -1741,7 +1773,7 @@ =item * -C<max_size> ??? Maximum response size in bytes (only when not using a data callback). If defined, responses larger than this will return an exception. +C<max_size> ??? Maximum response size in bytes (only when not using a data callback). If defined, requests with responses larger than this will return a 599 status code. =item * @@ -1761,7 +1793,7 @@ =item * -C<timeout> ??? Request timeout in seconds (default is 60) If a socket open, read or write takes longer than the timeout, an exception is thrown. +C<timeout> ??? Request timeout in seconds (default is 60) If a socket open, read or write takes longer than the timeout, the request response status code will be 599. =item * @@ -1773,22 +1805,24 @@ =back +An accessor/mutator method exists for each attribute. + Passing an explicit C<undef> for C<proxy>, C<http_proxy> or C<https_proxy> will prevent getting the corresponding proxies from the environment. -Exceptions from C<max_size>, C<timeout> or other errors will result in a -pseudo-HTTP status code of 599 and a reason of "Internal Exception". The -content field in the response will contain the text of the exception. +Errors during request execution will result in a pseudo-HTTP status code of 599 +and a reason of "Internal Exception". The content field in the response will +contain the text of the error. The C<keep_alive> parameter enables a persistent connection, but only to a -single destination scheme, host and port. Also, if any connection-relevant -attributes are modified, or if the process ID or thread ID change, the -persistent connection will be dropped. If you want persistent connections +single destination scheme, host and port. If any connection-relevant +attributes are modified via accessor, or if the process ID or thread ID change, +the persistent connection will be dropped. If you want persistent connections across multiple destinations, use multiple HTTP::Tiny objects. See L</SSL SUPPORT> for more on the C<verify_SSL> and C<SSL_options> attributes. -=head2 get|head|put|post|delete +=head2 get|head|put|post|patch|delete $response = $http->get($url); $response = $http->get($url, \%options); @@ -1948,8 +1982,8 @@ =back -On an exception during the execution of the request, the C<status> field will -contain 599, and the C<content> field will contain the text of the exception. +On an error during the execution of the request, the C<status> field will +contain 599, and the C<content> field will contain the text of the error. =head2 www_form_urlencode @@ -2012,8 +2046,8 @@ =head1 SSL SUPPORT Direct C<https> connections are supported only if L<IO::Socket::SSL> 1.56 or -greater and L<Net::SSLeay> 1.49 or greater are installed. An exception will be -thrown if new enough versions of these modules are not installed or if the SSL +greater and L<Net::SSLeay> 1.49 or greater are installed. An error will occur +if new enough versions of these modules are not installed or if the SSL encryption fails. You can also use C<HTTP::Tiny::can_ssl()> utility function that returns boolean to see if the required modules are installed. @@ -2083,7 +2117,7 @@ =back -An exception will be raised if C<verify_SSL> is true and no CA certificate file +An error will be occur if C<verify_SSL> is true and no CA certificate file is available. If you desire complete control over SSL connections, the C<SSL_options> attribute @@ -2127,7 +2161,7 @@ If the C<REQUEST_METHOD> environment variable is set, then this might be a CGI process and C<HTTP_PROXY> would be set from the C<Proxy:> header, which is a security risk. If C<REQUEST_METHOD> is set, C<HTTP_PROXY> (the upper case -variant only) is ignored. +variant only) is ignored, but C<CGI_HTTP_PROXY> is considered instead. Tunnelling C<https> over an C<http> proxy using the CONNECT method is supported. If your proxy uses C<https> itself, you can not tunnel C<https> @@ -2178,7 +2212,7 @@ It attempts to meet all "MUST" requirements of the specification, but does not implement all "SHOULD" requirements. (Note: it was developed against the earlier RFC 2616 specification and may not yet meet the revised RFC 7230-7235 -spec.) +spec.) Additionally, HTTP::Tiny supports the C<PATCH> method of RFC 5789. Some particular limitations of note include: @@ -2268,7 +2302,7 @@ =back -=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan +=for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT @@ -2303,7 +2337,7 @@ =head1 CONTRIBUTORS -=for stopwords Alan Gardner Alessandro Ghedini A. Sinan Unur Brad Gilbert brian m. carlson Chris Nehren Weyl Claes Jakobsson Clinton Gormley Craig Berry David Golden Mitchell Dean Pearce Edward Zborowski Felipe Gasper James Raspass Jeremy Mates Jess Robinson Karen Etheridge Lukas Eklund Martin J. Evans Martin-Louis Bright Mike Doherty Nicolas Rochelemagne Olaf Alders Olivier Mengu?? Petr P??sa?? Serguei Trouchelle Shoichi Kaji SkyMarshal S??ren Kornetzki Steve Grazzini Syohei YOSHIDA Tatsuhiko Miyagawa Tom Hukins Tony Cook +=for stopwords Alan Gardner Alessandro Ghedini A. Sinan Unur Brad Gilbert brian m. carlson Chris Nehren Weyl Claes Jakobsson Clinton Gormley Craig Berry David Golden Mitchell Dean Pearce Edward Zborowski Felipe Gasper Greg Kennedy James E Keenan Raspass Jeremy Mates Jess Robinson Karen Etheridge Lukas Eklund Martin J. Evans Martin-Louis Bright Matthew Horsfall Michael R. Davis Mike Doherty Nicolas Rochelemagne Olaf Alders Olivier Mengu?? Petr P??sa?? sanjay-cpu Serguei Trouchelle Shoichi Kaji SkyMarshal S??ren Kornetzki Steve Grazzini Syohei YOSHIDA Tatsuhiko Miyagawa Tom Hukins Tony Cook Xavier Guimard =over 4 @@ -2373,6 +2407,14 @@ =item * +Greg Kennedy <kennedy.g...@gmail.com> + +=item * + +James E Keenan <jkee...@cpan.org> + +=item * + James Raspass <jrasp...@gmail.com> =item * @@ -2401,6 +2443,14 @@ =item * +Matthew Horsfall <wolfs...@gmail.com> + +=item * + +Michael R. Davis <mrdv...@users.noreply.github.com> + +=item * + Mike Doherty <dohe...@cpan.org> =item * @@ -2421,6 +2471,10 @@ =item * +sanjay-cpu <snjkm...@gmail.com> + +=item * + Serguei Trouchelle <s...@cpan.org> =item * @@ -2455,11 +2509,15 @@ Tony Cook <t...@develop-help.com> +=item * + +Xavier Guimard <y...@debian.org> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2018 by Christian Hansen. +This software is copyright (c) 2021 by Christian Hansen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/00-report-prereqs.t new/HTTP-Tiny-0.078/t/00-report-prereqs.t --- old/HTTP-Tiny-0.076/t/00-report-prereqs.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/00-report-prereqs.t 2021-08-02 15:24:17.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 use Test::More tests => 1; @@ -188,6 +188,6 @@ ); } -pass; +pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/001_api.t new/HTTP-Tiny-0.078/t/001_api.t --- old/HTTP-Tiny-0.076/t/001_api.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/001_api.t 2021-08-02 15:24:17.000000000 +0200 @@ -11,7 +11,7 @@ max_redirect max_size proxy no_proxy timeout SSL_options verify_SSL cookie_jar ); my @methods = qw( - new get head put post delete post_form request mirror www_form_urlencode can_ssl + new get head put post patch delete post_form request mirror www_form_urlencode can_ssl connected ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/002_croakage.t new/HTTP-Tiny-0.078/t/002_croakage.t --- old/HTTP-Tiny-0.076/t/002_croakage.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/002_croakage.t 2021-08-02 15:24:17.000000000 +0200 @@ -5,7 +5,7 @@ use Test::More; use lib 't'; -use Util qw[tmpfile monkey_patch set_socket_source]; +use Util qw[tmpfile monkey_patch set_socket_source clear_socket_source]; use HTTP::Tiny; @@ -35,6 +35,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new; +clear_socket_source(); set_socket_source($req_fh, $res_fh); for my $c ( @cases ) { @@ -48,5 +49,21 @@ is( $res->{status}, 599, "Providing a Host header errors with 599" ); like( $res->{content}, qr/'Host' header/, "Providing a Host header gives right error message" ); +$res = eval { $http->head("hxxp://www.example.com/") }; +is( $res->{status}, 599, "Error on unsupported scheme" ); +like( + $res->{content}, + qr/Unsupported URL scheme 'hxxp'/, + "Error for unsupported scheme" +); + +$res = eval { $http->post_form("http://www.example.com/", [undef, "123"]) }; +my $err = $@; +like( + $err, + qr/form data keys must not be undef/, + "Error for undef key in form" +); + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/003_agent.t new/HTTP-Tiny-0.078/t/003_agent.t --- old/HTTP-Tiny-0.076/t/003_agent.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/003_agent.t 2021-08-02 15:24:17.000000000 +0200 @@ -6,8 +6,8 @@ use Test::More tests => 8; use HTTP::Tiny; -# a couple tests to ensure that we get the default agent expected, the coorect -# agent when specified, and the correct agent when specifified with a space at +# a couple tests to ensure that we get the default agent expected, the correct +# agent when specified, and the correct agent when specified with a space at # the end of the string (as LWP::UserAgent does) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/030_response.t new/HTTP-Tiny-0.078/t/030_response.t --- old/HTTP-Tiny-0.076/t/030_response.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/030_response.t 2021-08-02 15:24:17.000000000 +0200 @@ -34,3 +34,40 @@ is_deeply(_header($handle->read_response_header), $exp, "->read_response_header LF"); } +{ + # broken status-line + my $response = join $LF, "HTTP/08.15 66x Foo\nbar", 'Foo: Foo', 'Bar: Bar', '', ''; + my $fh = tmpfile($response); + my $handle = HTTP::Tiny::Handle->new(fh => $fh); + my $res = eval{ $handle->read_response_header }; + my $err = $@; + like $err, qr/Malformed Status-Line: /, '->read_response_header diagnoses malformed status line'; +} + +{ + my $response = join $LF, "HTTP/2.0 200 Okish", 'Foo: Foo', 'Bar: Bar', '', ''; + my $fh = tmpfile($response); + my $handle = HTTP::Tiny::Handle->new(fh => $fh); + my $res = eval{ $handle->read_response_header }; + my $err = $@; + like $err, qr/Unsupported HTTP protocol: /, '->read_response_header unsupported HTTP protocol'; +} + +{ + # strict RFC7230#3.1.2 compliance, require space after code + my $response = join $LF, 'HTTP/1.1 200 ', 'Foo: Foo', 'Bar: Bar', '', ''; + my $fh = tmpfile($response); + my $handle = HTTP::Tiny::Handle->new(fh => $fh); + my $exp = [ 200, '', { foo => 'Foo', bar => 'Bar' }, 'HTTP/1.1' ]; + is_deeply(_header($handle->read_response_header), $exp, "->read_response_header empty phrase preceded by SP"); +} + +{ + # practical RFC7230#3.1.2 interpretation, require space after code + # only if there is a reason-phrase + my $response = join $LF, 'HTTP/1.1 200', 'Foo: Foo', 'Bar: Bar', '', ''; + my $fh = tmpfile($response); + my $handle = HTTP::Tiny::Handle->new(fh => $fh); + my $exp = [ 200, '', { foo => 'Foo', bar => 'Bar' }, 'HTTP/1.1' ]; + is_deeply(_header($handle->read_response_header), $exp, "->read_response_header empty phrase without preceding SP"); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/100_get.t new/HTTP-Tiny-0.078/t/100_get.t --- old/HTTP-Tiny-0.076/t/100_get.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/100_get.t 2021-08-02 15:24:17.000000000 +0200 @@ -7,7 +7,8 @@ use Test::More 0.88; use lib 't'; use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case - hashify connect_args set_socket_source sort_headers $CRLF $LF]; + hashify connect_args clear_socket_source set_socket_source sort_headers + $CRLF $LF]; use HTTP::Tiny; BEGIN { monkey_patch() } @@ -42,6 +43,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new(keep_alive => 0, %new_args); + clear_socket_source(); set_socket_source($req_fh, $res_fh); (my $url_basename = $url) =~ s{.*/}{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/101_head.t new/HTTP-Tiny-0.078/t/101_head.t --- old/HTTP-Tiny-0.076/t/101_head.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/101_head.t 2021-08-02 15:24:17.000000000 +0200 @@ -6,8 +6,8 @@ use File::Basename; use Test::More 0.88; use lib 't'; -use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case - set_socket_source sort_headers $CRLF $LF]; +use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case + clear_socket_source set_socket_source sort_headers $CRLF $LF]; use HTTP::Tiny; BEGIN { monkey_patch() } @@ -47,6 +47,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new( keep_alive => 0 ); + clear_socket_source(); set_socket_source($req_fh, $res_fh); (my $url_basename = $url) =~ s{.*/}{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/102_put.t new/HTTP-Tiny-0.078/t/102_put.t --- old/HTTP-Tiny-0.076/t/102_put.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/102_put.t 2021-08-02 15:24:17.000000000 +0200 @@ -6,8 +6,8 @@ use File::Basename; use Test::More 0.88; use lib 't'; -use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case - set_socket_source sort_headers $CRLF $LF]; +use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case + clear_socket_source set_socket_source sort_headers $CRLF $LF]; use HTTP::Tiny; BEGIN { monkey_patch() } @@ -34,6 +34,9 @@ if ( $case->{content} ) { $options{content} = $case->{content}[0]; } + elsif ( exists $case->{content} ) { + $options{content} = ""; + } elsif ( $case->{content_cb} ) { $options{content} = eval join "\n", @{$case->{content_cb}}; } @@ -47,6 +50,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new( keep_alive => 0 ); + clear_socket_source(); set_socket_source($req_fh, $res_fh); (my $url_basename = $url) =~ s{.*/}{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/103_delete.t new/HTTP-Tiny-0.078/t/103_delete.t --- old/HTTP-Tiny-0.076/t/103_delete.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/103_delete.t 2021-08-02 15:24:17.000000000 +0200 @@ -6,8 +6,8 @@ use File::Basename; use Test::More 0.88; use lib 't'; -use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case - set_socket_source sort_headers $CRLF $LF]; +use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case + clear_socket_source set_socket_source sort_headers $CRLF $LF]; use HTTP::Tiny; BEGIN { monkey_patch() } @@ -47,6 +47,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new( keep_alive => 0 ); + clear_socket_source(); set_socket_source($req_fh, $res_fh); (my $url_basename = $url) =~ s{.*/}{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/104_post.t new/HTTP-Tiny-0.078/t/104_post.t --- old/HTTP-Tiny-0.076/t/104_post.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/104_post.t 2021-08-02 15:24:17.000000000 +0200 @@ -6,8 +6,8 @@ use File::Basename; use Test::More 0.88; use lib 't'; -use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case - set_socket_source sort_headers $CRLF $LF]; +use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case + clear_socket_source set_socket_source sort_headers $CRLF $LF]; use HTTP::Tiny; BEGIN { monkey_patch() } @@ -47,6 +47,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new( keep_alive => 0 ); + clear_socket_source(); set_socket_source($req_fh, $res_fh); (my $url_basename = $url) =~ s{.*/}{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/110_mirror.t new/HTTP-Tiny-0.078/t/110_mirror.t --- old/HTTP-Tiny-0.076/t/110_mirror.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/110_mirror.t 2021-08-02 15:24:17.000000000 +0200 @@ -6,8 +6,8 @@ use File::Basename; use Test::More 0.88; use lib 't'; -use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case - set_socket_source sort_headers $CRLF $LF]; +use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case + clear_socket_source set_socket_source sort_headers $CRLF $LF]; use HTTP::Tiny; use File::Temp qw/tempdir/; use File::Spec; @@ -64,6 +64,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new( keep_alive => 0 ); + clear_socket_source(); set_socket_source($req_fh, $res_fh); my @call_args = %options ? ($url, $tempfile, \%options) : ($url, $tempfile); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/140_proxy.t new/HTTP-Tiny-0.078/t/140_proxy.t --- old/HTTP-Tiny-0.076/t/140_proxy.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/140_proxy.t 2021-08-02 15:24:17.000000000 +0200 @@ -80,4 +80,14 @@ } +# allow CGI_HTTP_PROXY with REQUEST_METHOD +{ + local $ENV{HTTP_PROXY} = "http://localhost:8080"; + local $ENV{CGI_HTTP_PROXY} = "http://localhost:9090"; + local $ENV{REQUEST_METHOD} = 'GET'; + my $c = HTTP::Tiny->new(); + is($c->http_proxy, "http://localhost:9090", + "http_proxy set from CGI_HTTP_PROXY if REQUEST_METHOD set"); +} + done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/150_post_form.t new/HTTP-Tiny-0.078/t/150_post_form.t --- old/HTTP-Tiny-0.076/t/150_post_form.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/150_post_form.t 2021-08-02 15:24:17.000000000 +0200 @@ -7,8 +7,8 @@ use File::Basename; use Test::More 0.88; use lib 't'; -use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case - set_socket_source sort_headers $CRLF $LF]; +use Util qw[tmpfile rewind slurp monkey_patch dir_list parse_case + clear_socket_source set_socket_source sort_headers $CRLF $LF]; use HTTP::Tiny; BEGIN { monkey_patch() } @@ -38,6 +38,9 @@ if ( $case->{datatype}[0] eq 'HASH' ) { while ( @params ) { my ($key, $value) = splice( @params, 0, 2 ); + if ($value eq "<undef>") { + $value = undef; + } if ( ref $formdata->{$key} ) { push @{$formdata->{$key}}, $value; } @@ -50,7 +53,7 @@ } } else { - $formdata = [ @params ]; + $formdata = [ map { $_ eq "<undef>" ? undef : $_ } @params ]; } # setup mocking and test @@ -58,6 +61,7 @@ my $req_fh = tmpfile(); my $http = HTTP::Tiny->new( keep_alive => 0 ); + clear_socket_source(); set_socket_source($req_fh, $res_fh); (my $url_basename = $url) =~ s{.*/}{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/t/Util.pm new/HTTP-Tiny-0.078/t/Util.pm --- old/HTTP-Tiny-0.076/t/Util.pm 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/t/Util.pm 2021-08-02 15:24:17.000000000 +0200 @@ -87,6 +87,7 @@ my ($case) = @_; my %args; my $key = ''; + my %seen; for my $line ( split "\n", $case ) { chomp $line; if ( substr($line,0,1) eq q{ } ) { @@ -95,8 +96,12 @@ } else { $key = $line; + $seen{$key}++; } } + for my $k (keys %seen) { + $args{$k}=undef unless exists $args{$k}; + } return \%args; } @@ -168,6 +173,7 @@ $self->{fh} = shift @res_fh; }; *HTTP::Tiny::Handle::close = sub { 1 }; # don't close our temps + *HTTP::Tiny::Handle::connected = sub { 1 }; # don't try to proxy in mock-mode delete $ENV{$_} for map { $_, uc($_) } qw/http_proxy https_proxy all_proxy/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/xt/author/distmeta.t new/HTTP-Tiny-0.078/xt/author/distmeta.t --- old/HTTP-Tiny-0.076/xt/author/distmeta.t 1970-01-01 01:00:00.000000000 +0100 +++ new/HTTP-Tiny-0.078/xt/author/distmeta.t 2021-08-02 15:24:17.000000000 +0200 @@ -0,0 +1,6 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::MetaTests. + +use Test::CPAN::Meta; + +meta_yaml_ok(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/xt/author/minimum-version.t new/HTTP-Tiny-0.078/xt/author/minimum-version.t --- old/HTTP-Tiny-0.076/xt/author/minimum-version.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/xt/author/minimum-version.t 2021-08-02 15:24:17.000000000 +0200 @@ -1,6 +1,6 @@ -#!perl +use strict; +use warnings; use Test::More; - use Test::MinimumVersion; all_minimum_version_ok( qq{5.010} ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/xt/author/pod-spell.t new/HTTP-Tiny-0.078/xt/author/pod-spell.t --- old/HTTP-Tiny-0.076/xt/author/pod-spell.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/xt/author/pod-spell.t 2021-08-02 15:24:17.000000000 +0200 @@ -25,6 +25,7 @@ Cook Craig David +Davis Dean Doherty Edward @@ -39,8 +40,11 @@ Golden Gormley Grazzini +Greg +Guimard HTTP Hansen +Horsfall Hukins Jakobsson James @@ -48,11 +52,15 @@ Jess Kaji Karen +Keenan +Kennedy Kornetzki Lukas Martin Mates +Matthew Mengu?? +Michael Mike Mitchell Miyagawa @@ -81,6 +89,7 @@ UA Unur Weyl +Xavier YOSHIDA Zborowski al3xbio @@ -103,13 +112,16 @@ ether felipe gardner +jkeenan jmates jraspass +kennedy leklund lib miyagawa mjegh mlbright +mrdvt92 nanis olaf pearce @@ -117,12 +129,16 @@ proxying rochelemagne sandals +sanjay skaji skymarshal1729 +snjkmr32 soeren steve stro syohex tom tony +wolfsage xdg +yadd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-Tiny-0.076/xt/release/distmeta.t new/HTTP-Tiny-0.078/xt/release/distmeta.t --- old/HTTP-Tiny-0.076/xt/release/distmeta.t 2018-08-06 03:07:55.000000000 +0200 +++ new/HTTP-Tiny-0.078/xt/release/distmeta.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -#!perl -# This file was automatically generated by Dist::Zilla::Plugin::MetaTests. - -use Test::CPAN::Meta; - -meta_yaml_ok();