Imported Upstream version 6.39 upstream/6.39
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:24 +0000 (11:28 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:24 +0000 (11:28 +0900)
33 files changed:
Changes
INSTALL
MANIFEST
META.json
META.yml
Makefile.PL
dist.ini
examples/handler-order.pl [new file with mode: 0755]
lib/LWP.pm
lib/LWP/Authen/Basic.pm
lib/LWP/Authen/Digest.pm
lib/LWP/Authen/Ntlm.pm
lib/LWP/ConnCache.pm
lib/LWP/Debug.pm
lib/LWP/Debug/TraceHTTP.pm
lib/LWP/DebugFile.pm
lib/LWP/MemberMixin.pm
lib/LWP/Protocol.pm
lib/LWP/Protocol/cpan.pm
lib/LWP/Protocol/data.pm
lib/LWP/Protocol/file.pm
lib/LWP/Protocol/ftp.pm
lib/LWP/Protocol/gopher.pm
lib/LWP/Protocol/http.pm
lib/LWP/Protocol/loopback.pm
lib/LWP/Protocol/mailto.pm
lib/LWP/Protocol/nntp.pm
lib/LWP/Protocol/nogo.pm
lib/LWP/RobotUA.pm
lib/LWP/Simple.pm
lib/LWP/UserAgent.pm
t/base/protocols/nntp.t
xt/release/changes_has_content.t

diff --git a/Changes b/Changes
index 566e701fa5ecfccb267d90b3474f8f4eb9d8b7b4..ac2191548cee9a087143d447a3aef993c841f2eb 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
 Change history for libwww-perl
 
+6.39      2019-05-06 14:18:39Z
+    - Document current best practices (GH#314) (Olaf Alders)
+    - Document order in which handlers fire (GH#315) (Olaf Alders)
+    - SKIP nntp test for now (GH#317) (Olaf Alders)
+
 6.38      2019-03-25 18:58:58Z
     - Update Net::HTTP dependency from 6.07 to 6.18 (GH#310) (Olaf Alders)
     - Remove s.c.o. from SYNOPSIS (GH#308) (Olaf Alders)
diff --git a/INSTALL b/INSTALL
index c24b514906ee710bb6c6f6f398f06406b4a5a5cc..48656c39da6cabf19a118703d19635e75d85a8b2 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -6,7 +6,7 @@ Installing libwww-perl is straightforward.
 
 If you have cpanm, you only need one line:
 
-    % cpanm libwww::perl
+    % cpanm LWP
 
 If it does not have permission to install modules to the current perl, cpanm
 will automatically set up and install to a local::lib in your home directory.
@@ -17,7 +17,7 @@ details on enabling it in your environment.
 
 Alternatively, if your CPAN shell is set up, you should just be able to do:
 
-    % cpan libwww::perl
+    % cpan LWP
 
 ## Manual installation
 
@@ -66,7 +66,7 @@ They can all be found in the "PHASE_requires" key of MYMETA.yml or the
 libwww-perl documentation is available as POD.
 You can run `perldoc` from a shell to read the documentation:
 
-    % perldoc libwww::perl
+    % perldoc LWP
 
 For more information on installing Perl modules via CPAN, please see:
 https://www.cpan.org/modules/INSTALL.html
index bae6b69edffd17f52bf74135792e21871ed6791d..b937f709df248b91a5fd479fac03728787054511 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -14,6 +14,7 @@ bin/lwp-mirror
 bin/lwp-request
 cpanfile
 dist.ini
+examples/handler-order.pl
 lib/LWP.pm
 lib/LWP/Authen/Basic.pm
 lib/LWP/Authen/Digest.pm
index 70b961b5b23ac3acdefc9e2019d23d86cc4fb824..ed68c8201e24e6a9e5db590a4018e2faf729dcad 100644 (file)
--- a/META.json
+++ b/META.json
    "provides" : {
       "LWP" : {
          "file" : "lib/LWP.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Authen::Basic" : {
          "file" : "lib/LWP/Authen/Basic.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Authen::Digest" : {
          "file" : "lib/LWP/Authen/Digest.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Authen::Ntlm" : {
          "file" : "lib/LWP/Authen/Ntlm.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::ConnCache" : {
          "file" : "lib/LWP/ConnCache.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Debug" : {
          "file" : "lib/LWP/Debug.pm",
-         "version" : "6.38",
+         "version" : "6.39",
          "x_deprecated" : 1
       },
       "LWP::Debug::TraceHTTP" : {
          "file" : "lib/LWP/Debug/TraceHTTP.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::DebugFile" : {
          "file" : "lib/LWP/DebugFile.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::MemberMixin" : {
          "file" : "lib/LWP/MemberMixin.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol" : {
          "file" : "lib/LWP/Protocol.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::cpan" : {
          "file" : "lib/LWP/Protocol/cpan.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::data" : {
          "file" : "lib/LWP/Protocol/data.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::file" : {
          "file" : "lib/LWP/Protocol/file.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::ftp" : {
          "file" : "lib/LWP/Protocol/ftp.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::gopher" : {
          "file" : "lib/LWP/Protocol/gopher.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::http" : {
          "file" : "lib/LWP/Protocol/http.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::loopback" : {
          "file" : "lib/LWP/Protocol/loopback.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::mailto" : {
          "file" : "lib/LWP/Protocol/mailto.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::nntp" : {
          "file" : "lib/LWP/Protocol/nntp.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Protocol::nogo" : {
          "file" : "lib/LWP/Protocol/nogo.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::RobotUA" : {
          "file" : "lib/LWP/RobotUA.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::Simple" : {
          "file" : "lib/LWP/Simple.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       },
       "LWP::UserAgent" : {
          "file" : "lib/LWP/UserAgent.pm",
-         "version" : "6.38"
+         "version" : "6.39"
       }
    },
    "release_status" : "stable",
       "x_IRC" : "irc://irc.perl.org/#lwp",
       "x_MailingList" : "mailto:libwww@perl.org"
    },
-   "version" : "6.38",
+   "version" : "6.39",
    "x_Dist_Zilla" : {
       "perl" : {
          "version" : "5.026001"
             "class" : "Dist::Zilla::Plugin::Git::Contributors",
             "config" : {
                "Dist::Zilla::Plugin::Git::Contributors" : {
-                  "git_version" : "2.20.1",
+                  "git_version" : "2.21.0",
                   "include_authors" : 0,
                   "include_releaser" : 1,
                   "order_by" : "name",
          },
          {
             "class" : "Dist::Zilla::Plugin::InstallGuide",
+            "config" : {
+               "Dist::Zilla::Role::ModuleMetadata" : {
+                  "Module::Metadata" : "1.000033",
+                  "version" : "0.004"
+               }
+            },
             "name" : "InstallGuide",
-            "version" : "1.200012"
+            "version" : "1.200013"
          },
          {
             "class" : "Dist::Zilla::Plugin::ExecDir",
                }
             },
             "name" : "MakeMaker::Awesome",
-            "version" : "0.41"
+            "version" : "0.47"
          },
          {
             "class" : "Dist::Zilla::Plugin::MojibakeTests",
                   "changelog" : "Changes"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.20.1",
+                  "git_version" : "2.21.0",
                   "repo_root" : "."
                }
             },
                   "changelog" : "Changes"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.20.1",
+                  "git_version" : "2.21.0",
                   "repo_root" : "."
                },
                "Dist::Zilla::Role::Git::StringFormatter" : {
                   "branch" : null,
                   "changelog" : "Changes",
                   "signed" : 0,
-                  "tag" : "v6.38",
+                  "tag" : "v6.39",
                   "tag_format" : "v%V",
                   "tag_message" : "v%V"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.20.1",
+                  "git_version" : "2.21.0",
                   "repo_root" : "."
                },
                "Dist::Zilla::Role::Git::StringFormatter" : {
                   "changelog" : "Changes"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.20.1",
+                  "git_version" : "2.21.0",
                   "repo_root" : "."
                },
                "Dist::Zilla::Role::Git::StringFormatter" : {
                   "remotes_must_exist" : 1
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.20.1",
+                  "git_version" : "2.21.0",
                   "repo_root" : "."
                }
             },
index 461596c8d86e270b4371be6f06e11c80d2aafa65..0173f02952710784a645fd1ace912a824a5e1b4e 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -30,74 +30,74 @@ no_index:
 provides:
   LWP:
     file: lib/LWP.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Authen::Basic:
     file: lib/LWP/Authen/Basic.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Authen::Digest:
     file: lib/LWP/Authen/Digest.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Authen::Ntlm:
     file: lib/LWP/Authen/Ntlm.pm
-    version: '6.38'
+    version: '6.39'
   LWP::ConnCache:
     file: lib/LWP/ConnCache.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Debug:
     file: lib/LWP/Debug.pm
-    version: '6.38'
+    version: '6.39'
     x_deprecated: 1
   LWP::Debug::TraceHTTP:
     file: lib/LWP/Debug/TraceHTTP.pm
-    version: '6.38'
+    version: '6.39'
   LWP::DebugFile:
     file: lib/LWP/DebugFile.pm
-    version: '6.38'
+    version: '6.39'
   LWP::MemberMixin:
     file: lib/LWP/MemberMixin.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol:
     file: lib/LWP/Protocol.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::cpan:
     file: lib/LWP/Protocol/cpan.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::data:
     file: lib/LWP/Protocol/data.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::file:
     file: lib/LWP/Protocol/file.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::ftp:
     file: lib/LWP/Protocol/ftp.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::gopher:
     file: lib/LWP/Protocol/gopher.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::http:
     file: lib/LWP/Protocol/http.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::loopback:
     file: lib/LWP/Protocol/loopback.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::mailto:
     file: lib/LWP/Protocol/mailto.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::nntp:
     file: lib/LWP/Protocol/nntp.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Protocol::nogo:
     file: lib/LWP/Protocol/nogo.pm
-    version: '6.38'
+    version: '6.39'
   LWP::RobotUA:
     file: lib/LWP/RobotUA.pm
-    version: '6.38'
+    version: '6.39'
   LWP::Simple:
     file: lib/LWP/Simple.pm
-    version: '6.38'
+    version: '6.39'
   LWP::UserAgent:
     file: lib/LWP/UserAgent.pm
-    version: '6.38'
+    version: '6.39'
 requires:
   Digest::MD5: '0'
   Encode: '2.12'
@@ -134,7 +134,7 @@ resources:
   bugtracker: https://github.com/libwww-perl/libwww-perl/issues
   homepage: https://github.com/libwww-perl/libwww-perl
   repository: https://github.com/libwww-perl/libwww-perl.git
-version: '6.38'
+version: '6.39'
 x_Dist_Zilla:
   perl:
     version: '5.026001'
@@ -210,7 +210,7 @@ x_Dist_Zilla:
       class: Dist::Zilla::Plugin::Git::Contributors
       config:
         Dist::Zilla::Plugin::Git::Contributors:
-          git_version: 2.20.1
+          git_version: 2.21.0
           include_authors: 0
           include_releaser: 1
           order_by: name
@@ -235,8 +235,12 @@ x_Dist_Zilla:
       version: '6.012'
     -
       class: Dist::Zilla::Plugin::InstallGuide
+      config:
+        Dist::Zilla::Role::ModuleMetadata:
+          Module::Metadata: '1.000033'
+          version: '0.004'
       name: InstallGuide
-      version: '1.200012'
+      version: '1.200013'
     -
       class: Dist::Zilla::Plugin::ExecDir
       name: ExecDir
@@ -263,7 +267,7 @@ x_Dist_Zilla:
           default_jobs: 1
           version: '6.012'
       name: MakeMaker::Awesome
-      version: '0.41'
+      version: '0.47'
     -
       class: Dist::Zilla::Plugin::MojibakeTests
       name: MojibakeTests
@@ -474,7 +478,7 @@ x_Dist_Zilla:
           allow_dirty_match: []
           changelog: Changes
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.20.1
+          git_version: 2.21.0
           repo_root: .
       name: Git::Check
       version: '2.046'
@@ -571,7 +575,7 @@ x_Dist_Zilla:
           allow_dirty_match: []
           changelog: Changes
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.20.1
+          git_version: 2.21.0
           repo_root: .
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
@@ -584,11 +588,11 @@ x_Dist_Zilla:
           branch: ~
           changelog: Changes
           signed: 0
-          tag: v6.38
+          tag: v6.39
           tag_format: v%V
           tag_message: v%V
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.20.1
+          git_version: 2.21.0
           repo_root: .
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
@@ -625,7 +629,7 @@ x_Dist_Zilla:
             - (?^:^lib/.*\.pm$)
           changelog: Changes
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.20.1
+          git_version: 2.21.0
           repo_root: .
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
@@ -639,7 +643,7 @@ x_Dist_Zilla:
             - origin
           remotes_must_exist: 1
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.20.1
+          git_version: 2.21.0
           repo_root: .
       name: Git::Push
       version: '2.046'
index 1213e1b8bd5f86ccf5788ebb454181bddbb93648..67b0ccf4503ecce7a4ceafc4905d522439a5efc8 100644 (file)
@@ -1,5 +1,5 @@
 # This Makefile.PL for libwww-perl was generated by
-# Dist::Zilla::Plugin::MakeMaker::Awesome 0.41.
+# Dist::Zilla::Plugin::MakeMaker::Awesome 0.47.
 # Don't edit it but the dist.ini and plugins used to construct it.
 
 use strict;
@@ -86,7 +86,7 @@ my %WriteMakefileArgs = (
     "Test::Needs" => 0,
     "Test::RequiresInternet" => 0
   },
-  "VERSION" => "6.38",
+  "VERSION" => "6.39",
   "test" => {
     "TESTS" => "t/*.t t/base/*.t t/base/protocols/*.t t/leak/*.t t/local/*.t t/robot/*.t"
   }
@@ -138,7 +138,7 @@ my %FallbackPrereqs = (
 # inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.034
 requires('HTTP::Status', '6.18') if has_module('HTTP::Status', '6.17');
 
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) {
   delete $WriteMakefileArgs{TEST_REQUIRES};
   delete $WriteMakefileArgs{BUILD_REQUIRES};
   $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
index 206206f538bf39ead878f81f6a6d98f94a289553..f52d2a2e72a909146994d38681a6ee077d1727e1 100644 (file)
--- a/dist.ini
+++ b/dist.ini
@@ -33,6 +33,7 @@ authority = cpan:LWWWP
 [Manifest]
 [License]
 [InstallGuide]
+:version = 1.200013
 
 ; make the bin dir executables
 [ExecDir]
diff --git a/examples/handler-order.pl b/examples/handler-order.pl
new file mode 100755 (executable)
index 0000000..813fac7
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use feature qw( say );
+
+use LWP::UserAgent;
+my $ua = LWP::UserAgent->new;
+
+my @phases = (
+    'request_preprepare', 'request_prepare',
+    'request_send',       'response_header',
+    'response_data',      'response_done',
+    'response_redirect',
+);
+
+for my $phase (@phases) {
+    $ua->add_handler($phase => sub { say "$phase"; return undef; });
+}
+
+$ua->get('http://example.com');
index 6bd840e19f5dce69a4cd645d8f919ee09e3c4d74..47a8e2011d37a4924ba125d034d536e4b363e4d2 100644 (file)
@@ -1,6 +1,6 @@
 package LWP;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require LWP::UserAgent;  # this should load everything you need
 
index f11b7164cc49fda6ac07a82f93417a6c873d36dd..f24a3e5ff8cf51d1d0879ae4100e7f0264aa831f 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Authen::Basic;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require MIME::Base64;
 
index 70fba9a9c38f217cf05039d3c5bd77234b01e3c7..0376d15d393a1aab6d427ba52d15fbe7863f52b1 100644 (file)
@@ -3,7 +3,7 @@ package LWP::Authen::Digest;
 use strict;
 use base 'LWP::Authen::Basic';
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require Digest::MD5;
 
index f75fe1358e5ed925007d62b852767ead8baefdab..0808e76512f0aab397dd941dbd3d6c7cdfc74e2c 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Authen::Ntlm;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 use Authen::NTLM "1.02";
 use MIME::Base64 "2.12";
index d4a075cf468e4dc8cb28f3f2a5044864018af817..63e7088fedbe203df3dac0a7fea843493c308771 100644 (file)
@@ -2,7 +2,7 @@ package LWP::ConnCache;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 our $DEBUG;
 
 sub new {
index 502cd91c27be7b6e7fd8bf101082d23bafcde70d..ddf7fc191b887f133e7ba962726add99244c3a4d 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::Debug;    # legacy
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require Exporter;
 our @ISA       = qw(Exporter);
index fa45df10b3dd6ae3b367afa610195b0520d0b4b6..1b1ffca21bf96ddadf4b877160d4a097f3fc255e 100644 (file)
@@ -11,7 +11,7 @@ package LWP::Debug::TraceHTTP;
 use strict;
 use base 'LWP::Protocol::http';
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 package # hide from PAUSE
     LWP::Debug::TraceHTTP::Socket;
index c53e63aa70de503f194e58c7eb6ad1fcd91c1446..d5762f672a2206139f0c6bdf60edb944dc56bf27 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::DebugFile;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 # legacy stub
 
index 278d00fa571924c1052fe535c2f90832134dae5e..965b94f995d581426c646e5df2c6c7949ca1987a 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::MemberMixin;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 sub _elem {
     my $self = shift;
index 5082841c6d24ea16142aaaf091ab284b0557d03e..dff69ac039a38ba44422b0c525801c337c716cb5 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol;
 
 use base 'LWP::MemberMixin';
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 use strict;
 use Carp ();
index 491e6b439adee45787216eccf15d872f1e1e956a..12e2ce9fb58fc161c0a2142397594ba9b3b39399 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 
 use base qw(LWP::Protocol);
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require URI;
 require HTTP::Status;
index d1ba58c134e3f702cead7bc2c9a54a9dd02eedf9..186cea03b66e3c36498cb21e25bc56a4d1fd0fa0 100644 (file)
@@ -4,7 +4,7 @@ package LWP::Protocol::data;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require HTTP::Response;
 require HTTP::Status;
index 5f8c7d8600d59f1020417c5a728dbafbb3a5c76c..18a11ed28e432e297fb105e1387db9afdbe3e5b4 100644 (file)
@@ -4,7 +4,7 @@ use base qw(LWP::Protocol);
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require LWP::MediaTypes;
 require HTTP::Request;
index 2f4b44c6aa1b62081499991dbf9312e4e12549e5..9bd705a4bf4af0f1cb4fc88a21535cfb2e0ef424 100644 (file)
@@ -5,7 +5,7 @@ package LWP::Protocol::ftp;
 use base qw(LWP::Protocol);
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 use Carp            ();
 use HTTP::Status    ();
index e9457eeeb47ffdf4fd6ceb2137389fb47d772e52..a89ad28c757a330ead122a8869feba227189419f 100644 (file)
@@ -9,7 +9,7 @@ package LWP::Protocol::gopher;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require HTTP::Response;
 require HTTP::Status;
index 566a558485f2e61d978f568394d705be90674cdd..9aaf19892cd6b97312ea9b1d6c84768b853320ea 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol::http;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require HTTP::Response;
 require HTTP::Status;
index 52dda1fc6b5c9cefe10edca9ae7aecb2be7c8de2..d50fa53f8ea3cd4356aad880ab89b3cdf1ec54f0 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol::loopback;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require HTTP::Response;
 
index ba97b9a6992fc8e96a78b053e181157ee739b947..6e205ec09fa9384dee573a82bf0cde2514b686d5 100644 (file)
@@ -11,7 +11,7 @@ require HTTP::Status;
 use Carp;
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 use base qw(LWP::Protocol);
 our $SENDMAIL;
index c271d6bd3185adc1dab753cc19091b54e97792f2..e69330fba754ef92b618c9cb78de2444cfc97ee4 100644 (file)
@@ -4,7 +4,7 @@ package LWP::Protocol::nntp;
 
 use base qw(LWP::Protocol);
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require HTTP::Response;
 require HTTP::Status;
index 1b7cc3b3ccc6e31e7e11a82cd619f690f0c26935..a362faed2686c61a09c6f608be19f6afadf97900 100644 (file)
@@ -7,7 +7,7 @@ package LWP::Protocol::nogo;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require HTTP::Response;
 require HTTP::Status;
index 720d3f3408c124d9bc1476dca49adee4ba4ae1cd..c2b46512b245cb022c96e21d7cd2679dcadaa997 100644 (file)
@@ -2,7 +2,7 @@ package LWP::RobotUA;
 
 use base qw(LWP::UserAgent);
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require WWW::RobotRules;
 require HTTP::Request;
index a33e4d5f0b85fc58c6c405609a4f324832e57c13..75cb7d02e16e2dbba8e14b8587133b0a2400a7d1 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Simple;
 
 use strict;
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 require Exporter;
 
index e9b4dcfea497aa7b4b97b4ad6a8c20afbd1d7439..3690bd5df284ef36339d5a9e48ea7a42e6c15476 100644 (file)
@@ -15,7 +15,7 @@ use LWP::Protocol ();
 use Scalar::Util qw(blessed);
 use Try::Tiny qw(try catch);
 
-our $VERSION = '6.38';
+our $VERSION = '6.39';
 
 sub new
 {
@@ -1133,22 +1133,48 @@ LWP::UserAgent - Web user agent class
 
 =head1 SYNOPSIS
 
- use strict;
- use warnings;
- use LWP::UserAgent ();
+    use strict;
+    use warnings;
 
- my $ua = LWP::UserAgent->new;
- $ua->timeout(10);
- $ua->env_proxy;
+    use LWP::UserAgent ();
 
- my $response = $ua->get('http://example.com');
+    my $ua = LWP::UserAgent->new(timeout => 10);
+    $ua->env_proxy;
+
+    my $response = $ua->get('http://example.com');
+
+    if ($response->is_success) {
+        print $response->decoded_content;
+    }
+    else {
+        die $response->status_line;
+    }
+
+Extra layers of security (note the C<cookie_jar> and C<protocols_allowed>):
+
+    use strict;
+    use warnings;
+
+    use HTTP::CookieJar::LWP ();
+    use LWP::UserAgent       ();
+
+    my $jar = HTTP::CookieJar::LWP->new;
+    my $ua  = LWP::UserAgent->new(
+        cookie_jar        => $jar,
+        protocols_allowed => ['http', 'https'],
+        timeout           => 10,
+    );
+
+    $ua->env_proxy;
 
- if ($response->is_success) {
-     print $response->decoded_content;  # or whatever
- }
- else {
-     die $response->status_line;
- }
+    my $response = $ua->get('http://example.com');
+
+    if ($response->is_success) {
+        print $response->decoded_content;
+    }
+    else {
+        die $response->status_line;
+    }
 
 =head1 DESCRIPTION
 
@@ -1276,7 +1302,16 @@ the cookie jar object must implement the C<extract_cookies($response)> and
 C<add_cookie_header($request)> methods.  These methods will then be
 invoked by the user agent as requests are sent and responses are
 received.  Normally this will be a L<HTTP::Cookies> object or some
-subclass.
+subclass.  You are, however, encouraged to use L<HTTP::CookieJar::LWP>
+instead.  See L</"BEST PRACTICES"> for more information.
+
+    use HTTP::CookieJar::LWP ();
+
+    my $jar = HTTP::CookieJar::LWP->new;
+    my $ua = LWP::UserAgent->new( cookie_jar => $jar );
+
+    # or after object creation
+    $ua->cookie_jar( $cookie_jar );
 
 The default is to have no cookie jar, i.e. never automatically add
 C<Cookie> headers to the requests.
@@ -1592,34 +1627,27 @@ the active handlers:
 Add handler to be invoked in the given processing phase.  For how to
 specify C<%matchspec> see L<HTTP::Config/"Matching">.
 
-The possible values C<$phase> and the corresponding callback signatures are:
-
-=over
-
-=item response_data => sub { my($response, $ua, $handler, $data) = @_; ... }
-
-This handler is called for each chunk of data received for the
-response.  The handler might croak to abort the request.
-
-This handler needs to return a TRUE value to be called again for
-subsequent chunks for the same request.
-
-=item response_done => sub { my($response, $ua, $handler) = @_; ... }
+The possible values C<$phase> and the corresponding callback signatures are as
+follows.  Note that the handlers are documented in the order in which they will
+be run, which is:
 
-The handler is called after the response has been fully received, but
-before any redirect handling is attempted.  The handler can be used to
-extract information or modify the response.
+    request_preprepare
+    request_prepare
+    request_send
+    response_header
+    response_data
+    response_done
+    response_redirect
 
-=item response_header => sub { my($response, $ua, $handler) = @_; ... }
+=over
 
-This handler is called right after the response headers have been
-received, but before any content data.  The handler might set up
-handlers for data and might croak to abort the request.
+=item request_preprepare => sub { my($request, $ua, $handler) = @_; ... }
 
-The handler might set the C<< $response->{default_add_content} >> value to
-control if any received data should be added to the response object
-directly.  This will initially be false if the C<< $ua->request() >> method
-was called with a C<$content_file> or C<$content_cb argument>; otherwise true.
+The handler is called before the C<request_prepare> and other standard
+initialization of the request.  This can be used to set up headers
+and attributes that the C<request_prepare> handler depends on.  Proxy
+initialization should take place here; but in general don't register
+handlers for this phase.
 
 =item request_prepare => sub { my($request, $ua, $handler) = @_; ... }
 
@@ -1634,14 +1662,6 @@ The return value from the callback is ignored.  If an exception is
 raised it will abort the request and make the request method return a
 "400 Bad request" response.
 
-=item request_preprepare => sub { my($request, $ua, $handler) = @_; ... }
-
-The handler is called before the C<request_prepare> and other standard
-initialization of the request.  This can be used to set up headers
-and attributes that the C<request_prepare> handler depends on.  Proxy
-initialization should take place here; but in general don't register
-handlers for this phase.
-
 =item request_send => sub { my($request, $ua, $handler) = @_; ... }
 
 This handler gets a chance of handling requests before they're sent to the
@@ -1651,6 +1671,31 @@ wishes to terminate the processing; otherwise it should return nothing.
 The C<response_header> and C<response_data> handlers will not be
 invoked for this response, but the C<response_done> will be.
 
+=item response_header => sub { my($response, $ua, $handler) = @_; ... }
+
+This handler is called right after the response headers have been
+received, but before any content data.  The handler might set up
+handlers for data and might croak to abort the request.
+
+The handler might set the C<< $response->{default_add_content} >> value to
+control if any received data should be added to the response object
+directly.  This will initially be false if the C<< $ua->request() >> method
+was called with a C<$content_file> or C<$content_cb argument>; otherwise true.
+
+=item response_data => sub { my($response, $ua, $handler, $data) = @_; ... }
+
+This handler is called for each chunk of data received for the
+response.  The handler might croak to abort the request.
+
+This handler needs to return a TRUE value to be called again for
+subsequent chunks for the same request.
+
+=item response_done => sub { my($response, $ua, $handler) = @_; ... }
+
+The handler is called after the response has been fully received, but
+before any redirect handling is attempted.  The handler can be used to
+extract information or modify the response.
+
 =item response_redirect => sub { my($response, $ua, $handler) = @_; ... }
 
 The handler is called in C<< $ua->request >> after C<response_done>.  If the
@@ -1988,6 +2033,47 @@ is in the object's C<requests_redirectable> list,
 false if the proposed redirection is to a C<file://...>
 URL, and true otherwise.
 
+=head1 BEST PRACTICES
+
+The default settings can get you up and running quickly, but there are settings
+you can change in order to make your life easier.
+
+=head2 Handling Cookies
+
+You are encouraged to install L<Mozilla::PublicSuffix> and use
+L<HTTP::CookieJar::LWP> as your cookie jar.  L<HTTP::CookieJar::LWP> provides a
+better security model matching that of current Web browsers when
+L<Mozilla::PublicSuffix> is installed.
+
+    use HTTP::CookieJar::LWP ();
+
+    my $jar = HTTP::CookieJar::LWP->new;
+    my $ua = LWP::UserAgent->new( cookie_jar => $jar );
+
+See L</"cookie_jar"> for more information.
+
+=head2 Managing Protocols
+
+C<protocols_allowed> gives you the ability to whitelist the protocols you're
+willing to allow.
+
+    my $ua = LWP::UserAgent->new(
+        protocols_allowed => [ 'http', 'https' ]
+    );
+
+This will prevent you from inadvertently following URLs like
+C<file:///etc/passwd>.  See L</"protocols_allowed">.
+
+C<protocols_forbidden> gives you the ability to blacklist the protocols you're
+unwilling to allow.
+
+    my $ua = LWP::UserAgent->new(
+        protocols_forbidden => [ 'file', 'mailto', 'ssh', ]
+    );
+
+This can also prevent you from inadvertently following URLs like
+C<file:///etc/passwd>.  See L</protocols_forbidden>.
+
 =head1 SEE ALSO
 
 See L<LWP> for a complete overview of libwww-perl5.  See L<lwpcook>
index c53873c2a2f0acd6ab1ac97b3743ca739dba12e3..a9b102a74232c1e33fc43c4fe99d77f18496191d 100644 (file)
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 
 use LWP::UserAgent ();
-use Test::More;
+use Test::More skip_all => 'nntp.perl.org is unstable and Test::RequiresInternet is not catching it';
 use Test::RequiresInternet ( 'nntp.perl.org' => 119 );
 
 plan tests => 1;
index 335f6b89a3c2ab7f21f0f79ccdbcf25d746bd4db..c0586ee12ae81b6f22f0a35061a488c72efb3c44 100644 (file)
@@ -8,7 +8,7 @@ if (($ENV{TRAVIS_PULL_REQUEST} || '') eq 'false') {
 
 note 'Checking Changes';
 my $changes_file = 'Changes';
-my $newver = '6.38';
+my $newver = '6.39';
 my $trial_token = '-TRIAL';
 my $encoding = 'UTF-8';