Imported Upstream version 6.63 upstream/6.63
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:28 +0000 (11:28 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:28 +0000 (11:28 +0900)
30 files changed:
Changes
META.json
META.yml
Makefile.PL
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/local/http.t
xt/author/pod-spell.t
xt/release/changes_has_content.t

diff --git a/Changes b/Changes
index 88a507164a0ba5c873dc4aa5404df1665e646818..052d605d1bc4ff168e97a6a7cf84d91fb76ab785 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Change history for libwww-perl
 
+6.63      2022-04-25 15:24:10Z
+    - Redirect on meta refresh (GH#409) (grr)
+
 6.62      2022-04-05 01:04:17Z
     - Allow downloading to a filehandle (GH#400) (Andrew Fresh)
 
index f6f9100d0e805afbd956b190a7add12c3c7e6166..0acf00233b62b7bbfd3c7bebff36b131e2199c04 100644 (file)
--- a/META.json
+++ b/META.json
    "provides" : {
       "LWP" : {
          "file" : "lib/LWP.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Authen::Basic" : {
          "file" : "lib/LWP/Authen/Basic.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Authen::Digest" : {
          "file" : "lib/LWP/Authen/Digest.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Authen::Ntlm" : {
          "file" : "lib/LWP/Authen/Ntlm.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::ConnCache" : {
          "file" : "lib/LWP/ConnCache.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Debug" : {
          "file" : "lib/LWP/Debug.pm",
-         "version" : "6.62",
+         "version" : "6.63",
          "x_deprecated" : 1
       },
       "LWP::Debug::TraceHTTP" : {
          "file" : "lib/LWP/Debug/TraceHTTP.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::DebugFile" : {
          "file" : "lib/LWP/DebugFile.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::MemberMixin" : {
          "file" : "lib/LWP/MemberMixin.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol" : {
          "file" : "lib/LWP/Protocol.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::cpan" : {
          "file" : "lib/LWP/Protocol/cpan.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::data" : {
          "file" : "lib/LWP/Protocol/data.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::file" : {
          "file" : "lib/LWP/Protocol/file.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::ftp" : {
          "file" : "lib/LWP/Protocol/ftp.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::gopher" : {
          "file" : "lib/LWP/Protocol/gopher.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::http" : {
          "file" : "lib/LWP/Protocol/http.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::loopback" : {
          "file" : "lib/LWP/Protocol/loopback.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::mailto" : {
          "file" : "lib/LWP/Protocol/mailto.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::nntp" : {
          "file" : "lib/LWP/Protocol/nntp.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Protocol::nogo" : {
          "file" : "lib/LWP/Protocol/nogo.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::RobotUA" : {
          "file" : "lib/LWP/RobotUA.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::Simple" : {
          "file" : "lib/LWP/Simple.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       },
       "LWP::UserAgent" : {
          "file" : "lib/LWP/UserAgent.pm",
-         "version" : "6.62"
+         "version" : "6.63"
       }
    },
    "release_status" : "stable",
       "x_IRC" : "irc://irc.perl.org/#lwp",
       "x_MailingList" : "mailto:libwww@perl.org"
    },
-   "version" : "6.62",
+   "version" : "6.63",
    "x_Dist_Zilla" : {
       "perl" : {
          "version" : "5.034001"
             "class" : "Dist::Zilla::Plugin::Git::Contributors",
             "config" : {
                "Dist::Zilla::Plugin::Git::Contributors" : {
-                  "git_version" : "2.35.1",
+                  "git_version" : "2.36.0",
                   "include_authors" : 0,
                   "include_releaser" : 1,
                   "order_by" : "name",
                   "changelog" : "Changes"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.35.1",
+                  "git_version" : "2.36.0",
                   "repo_root" : "."
                }
             },
                   "changelog" : "Changes"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.35.1",
+                  "git_version" : "2.36.0",
                   "repo_root" : "."
                },
                "Dist::Zilla::Role::Git::StringFormatter" : {
                   "branch" : null,
                   "changelog" : "Changes",
                   "signed" : 0,
-                  "tag" : "v6.62",
+                  "tag" : "v6.63",
                   "tag_format" : "v%V",
                   "tag_message" : "v%V"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.35.1",
+                  "git_version" : "2.36.0",
                   "repo_root" : "."
                },
                "Dist::Zilla::Role::Git::StringFormatter" : {
                   "changelog" : "Changes"
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.35.1",
+                  "git_version" : "2.36.0",
                   "repo_root" : "."
                },
                "Dist::Zilla::Role::Git::StringFormatter" : {
                   "remotes_must_exist" : 1
                },
                "Dist::Zilla::Role::Git::Repo" : {
-                  "git_version" : "2.35.1",
+                  "git_version" : "2.36.0",
                   "repo_root" : "."
                }
             },
       "Graeme Thompson <Graeme.Thompson@mobilecohesion.com>",
       "Graham Knop <haarg@haarg.org>",
       "Gregory Oschwald <oschwald@gmail.com>",
+      "grr <grr@users.noreply.github.com>",
       "Hans-H. Froehlich <hfroehlich@co-de-co.de>",
       "Ian Kilgore <iank@cpan.org>",
       "Jacob J <waif@chaos2.org>",
index b989315c11db6532eda9d40e783375bdb0ca93d9..703e7f0ff3794564201983aa3a4b47c8c74a2d2a 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -31,74 +31,74 @@ no_index:
 provides:
   LWP:
     file: lib/LWP.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Authen::Basic:
     file: lib/LWP/Authen/Basic.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Authen::Digest:
     file: lib/LWP/Authen/Digest.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Authen::Ntlm:
     file: lib/LWP/Authen/Ntlm.pm
-    version: '6.62'
+    version: '6.63'
   LWP::ConnCache:
     file: lib/LWP/ConnCache.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Debug:
     file: lib/LWP/Debug.pm
-    version: '6.62'
+    version: '6.63'
     x_deprecated: 1
   LWP::Debug::TraceHTTP:
     file: lib/LWP/Debug/TraceHTTP.pm
-    version: '6.62'
+    version: '6.63'
   LWP::DebugFile:
     file: lib/LWP/DebugFile.pm
-    version: '6.62'
+    version: '6.63'
   LWP::MemberMixin:
     file: lib/LWP/MemberMixin.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol:
     file: lib/LWP/Protocol.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::cpan:
     file: lib/LWP/Protocol/cpan.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::data:
     file: lib/LWP/Protocol/data.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::file:
     file: lib/LWP/Protocol/file.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::ftp:
     file: lib/LWP/Protocol/ftp.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::gopher:
     file: lib/LWP/Protocol/gopher.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::http:
     file: lib/LWP/Protocol/http.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::loopback:
     file: lib/LWP/Protocol/loopback.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::mailto:
     file: lib/LWP/Protocol/mailto.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::nntp:
     file: lib/LWP/Protocol/nntp.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Protocol::nogo:
     file: lib/LWP/Protocol/nogo.pm
-    version: '6.62'
+    version: '6.63'
   LWP::RobotUA:
     file: lib/LWP/RobotUA.pm
-    version: '6.62'
+    version: '6.63'
   LWP::Simple:
     file: lib/LWP/Simple.pm
-    version: '6.62'
+    version: '6.63'
   LWP::UserAgent:
     file: lib/LWP/UserAgent.pm
-    version: '6.62'
+    version: '6.63'
 requires:
   Digest::MD5: '0'
   Encode: '2.12'
@@ -137,7 +137,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.62'
+version: '6.63'
 x_Dist_Zilla:
   perl:
     version: '5.034001'
@@ -213,7 +213,7 @@ x_Dist_Zilla:
       class: Dist::Zilla::Plugin::Git::Contributors
       config:
         Dist::Zilla::Plugin::Git::Contributors:
-          git_version: 2.35.1
+          git_version: 2.36.0
           include_authors: 0
           include_releaser: 1
           order_by: name
@@ -480,7 +480,7 @@ x_Dist_Zilla:
           allow_dirty_match: []
           changelog: Changes
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.35.1
+          git_version: 2.36.0
           repo_root: .
       name: Git::Check
       version: '2.048'
@@ -578,7 +578,7 @@ x_Dist_Zilla:
           allow_dirty_match: []
           changelog: Changes
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.35.1
+          git_version: 2.36.0
           repo_root: .
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
@@ -591,11 +591,11 @@ x_Dist_Zilla:
           branch: ~
           changelog: Changes
           signed: 0
-          tag: v6.62
+          tag: v6.63
           tag_format: v%V
           tag_message: v%V
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.35.1
+          git_version: 2.36.0
           repo_root: .
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
@@ -633,7 +633,7 @@ x_Dist_Zilla:
             - (?^:^lib/.*\.pm$)
           changelog: Changes
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.35.1
+          git_version: 2.36.0
           repo_root: .
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
@@ -647,7 +647,7 @@ x_Dist_Zilla:
             - origin
           remotes_must_exist: 1
         Dist::Zilla::Role::Git::Repo:
-          git_version: 2.35.1
+          git_version: 2.36.0
           repo_root: .
       name: Git::Push
       version: '2.048'
@@ -742,6 +742,7 @@ x_contributors:
   - 'Graeme Thompson <Graeme.Thompson@mobilecohesion.com>'
   - 'Graham Knop <haarg@haarg.org>'
   - 'Gregory Oschwald <oschwald@gmail.com>'
+  - 'grr <grr@users.noreply.github.com>'
   - 'Hans-H. Froehlich <hfroehlich@co-de-co.de>'
   - 'Ian Kilgore <iank@cpan.org>'
   - 'Jacob J <waif@chaos2.org>'
index 6d6ae0eafc626e0f43a778fe4fa56c647f8448db..d94bf37b5ca497fcbe8811cdd5c79e0b08e2e395 100644 (file)
@@ -89,7 +89,7 @@ my %WriteMakefileArgs = (
     "Test::Needs" => 0,
     "Test::RequiresInternet" => 0
   },
-  "VERSION" => "6.62",
+  "VERSION" => "6.63",
   "test" => {
     "TESTS" => "t/*.t t/base/*.t t/base/protocols/*.t t/leak/*.t t/local/*.t t/robot/*.t"
   }
index 2cea02d67fd8f115e76eb85434734fb721560627..51b7ddda9c967c576dc9098fe60a4d6c03ecd660 100644 (file)
@@ -1,6 +1,6 @@
 package LWP;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require LWP::UserAgent;  # this should load everything you need
 
index f5da4904c45c3192b249f33596469f13a06bc437..bc0992eac63199fb7f378e587634c1a67a7d6a3e 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Authen::Basic;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require Encode;
 require MIME::Base64;
index 8e79a69edc57ec1837443426df2d3e0796b38e4d..2101f044006fc8ef95317163de0bfe8cacbbf624 100644 (file)
@@ -3,7 +3,7 @@ package LWP::Authen::Digest;
 use strict;
 use parent 'LWP::Authen::Basic';
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require Digest::MD5;
 
index 70d1a180875b8a1354edb0b697f7cfb18034c639..d49eee39f2d63be448bf41403995b2b570c8345f 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Authen::Ntlm;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 use Authen::NTLM "1.02";
 use MIME::Base64 "2.12";
index 4dfdc6ed051cd03c8172de8c28602ce3fb982d7d..13b0920b80bd68c5ae836e2f26d92fe2d3e88abe 100644 (file)
@@ -2,7 +2,7 @@ package LWP::ConnCache;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 our $DEBUG;
 
 sub new {
index 1bfa167280858f7b3d16d23972df8cd1afabac69..af5160a8ee032ba0f418d4917b1600f4d6ed6d23 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::Debug;    # legacy
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require Exporter;
 our @ISA       = qw(Exporter);
index 1d85b92fb8ea2eeafe62d531fddb8b36f6b7a1c4..6657531b67f677c01929052d514797d697d98d41 100644 (file)
@@ -11,7 +11,7 @@ package LWP::Debug::TraceHTTP;
 use strict;
 use parent 'LWP::Protocol::http';
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 package # hide from PAUSE
     LWP::Debug::TraceHTTP::Socket;
index 0ad592015a87ef2ee49d2db3f81fa9980c0cfaac..2ca426a7f0f7b2b62b3c9fd692a3c5f3408d6e99 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::DebugFile;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 # legacy stub
 
index 90fb92e803b33f4006d073bee0c6bb367f188198..0dc0d7bb3d798d71ce28be6f9f09980f6b793526 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::MemberMixin;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 sub _elem {
     my $self = shift;
index c29f17b8d27091433fb39d917c48f8fc6d56ab3a..67e969166beef61be3976725f4616d56a6910a4f 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol;
 
 use parent 'LWP::MemberMixin';
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 use strict;
 use Carp ();
index 071c99f52a3af829b8323b0df196ded1acea5128..01857d9699177b6f2f8d05c705df624203c55738 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 
 use parent qw(LWP::Protocol);
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require URI;
 require HTTP::Status;
index ad4268bbd2d17c6ac7ff245c2d00d17e720036ae..5166bdc17b4a8b40a827fffd13fd3de19c34f16d 100644 (file)
@@ -4,7 +4,7 @@ package LWP::Protocol::data;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require HTTP::Response;
 require HTTP::Status;
index 24731321c3b5e87f84942c1908b691c26322cee8..6fdac2adcaf26e884d78be0ca626fb8fc045cf98 100644 (file)
@@ -4,7 +4,7 @@ use parent qw(LWP::Protocol);
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require LWP::MediaTypes;
 require HTTP::Request;
index e8ceb296cc1e974eaf750fdb199a7975eff66609..440ec65730410f98321f8ab2ab2b87e66f9fd7fd 100644 (file)
@@ -5,7 +5,7 @@ package LWP::Protocol::ftp;
 use parent qw(LWP::Protocol);
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 use Carp            ();
 use HTTP::Status    ();
index 89692f4ba6ec16ce74827f5d24360f6a7877ad70..742e5e76bf176685b770a453d08c146c9520f1f2 100644 (file)
@@ -9,7 +9,7 @@ package LWP::Protocol::gopher;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require HTTP::Response;
 require HTTP::Status;
index 01ef0b155b3f8af7d4cbfd33cb75f882c7759d0e..8d4c17f26ac7eab58a8be3d892d86dc42124076a 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol::http;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require HTTP::Response;
 require HTTP::Status;
index 9b50abe4b2d8c7c3bb525532e78ed93c13b50ebc..064f2da43e9e27ad27667a171c4536cb5cd9d4e6 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol::loopback;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require HTTP::Response;
 
index 02768171c3fdc98c781e6772eb0f2d06fc6a7d1a..f998b844c0a706242829b4503f91ad20ebb79e97 100644 (file)
@@ -11,7 +11,7 @@ require HTTP::Status;
 use Carp;
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 use parent qw(LWP::Protocol);
 our $SENDMAIL;
index 3aeb01865222ecc54b31869dcee8e6cf2088e952..97f5fa826048e9fbd65bc8d3e33574d29e346837 100644 (file)
@@ -4,7 +4,7 @@ package LWP::Protocol::nntp;
 
 use parent qw(LWP::Protocol);
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require HTTP::Response;
 require HTTP::Status;
index 9aa8f1a7e59a8d21f12455f9ef12742a10cb3cb9..26b15102a17f6ac3b0aae232c4b4e3f3f613a3ef 100644 (file)
@@ -7,7 +7,7 @@ package LWP::Protocol::nogo;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require HTTP::Response;
 require HTTP::Status;
index b0681961d1ed10f839561ea23fa66ca9d6f8788e..06ad0454a17ad08c4cc9e5e7d77dc8c767762aa6 100644 (file)
@@ -2,7 +2,7 @@ package LWP::RobotUA;
 
 use parent qw(LWP::UserAgent);
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require WWW::RobotRules;
 require HTTP::Request;
index 485cbf03ac82b59203f2b85e329f79576f6271ca..b7dbe998fe614600841f214114b8081cd48b1c17 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Simple;
 
 use strict;
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 require Exporter;
 
index 044594d94e46a83ab20c6778ab1dc92ad639df2d..a4f1887ae29f32314086a0d9a553b8bc28ab83ab 100644 (file)
@@ -17,7 +17,7 @@ use LWP::Protocol ();
 use Scalar::Util qw(blessed openhandle);
 use Try::Tiny qw(try catch);
 
-our $VERSION = '6.62';
+our $VERSION = '6.63';
 
 sub new
 {
@@ -303,7 +303,7 @@ sub request {
     $response->previous($previous) if $previous;
 
     if ($response->redirects >= $self->{max_redirect}) {
-        if ($response->header('Location')) {
+        if ($response->header('Location') or $response->header('Refresh')) {
             $response->header("Client-Warning" =>
                 "Redirect loop detected (max_redirect = $self->{max_redirect})"
             );
@@ -751,26 +751,42 @@ sub parse_head {
         my $flag = shift;
         my $parser;
         my $old = $self->set_my_handler("response_header", $flag ? sub {
-               my($response, $ua) = @_;
-               require HTML::HeadParser;
-               $parser = HTML::HeadParser->new;
-               $parser->xml_mode(1) if $response->content_is_xhtml;
-               $parser->utf8_mode(1) if $] >= 5.008 && $HTML::Parser::VERSION >= 3.40;
-
-               push(@{$response->{handlers}{response_data}}, {
-                  callback => sub {
-                      return unless $parser;
-                      unless ($parser->parse($_[3])) {
-                          my $h = $parser->header;
-                          my $r = $_[0];
-                          for my $f ($h->header_field_names) {
-                              $r->init_header($f, [$h->header($f)]);
-                          }
-                          undef($parser);
-                      }
-                  },
-              });
-
+                my($response, $ua) = @_;
+                require HTML::HeadParser;
+                $parser = HTML::HeadParser->new;
+                $parser->xml_mode(1) if $response->content_is_xhtml;
+                $parser->utf8_mode(1) if $] >= 5.008 && $HTML::Parser::VERSION >= 3.40;
+
+                push(@{$response->{handlers}{response_data}}, {
+                    callback => sub {
+                        return unless $parser;
+                        unless ($parser->parse($_[3])) {
+                            my $h = $parser->header;
+                            my $r = $_[0];
+                            for my $f ($h->header_field_names) {
+                                $r->init_header($f, [$h->header($f)]);
+                            }
+                            undef($parser);
+                        }
+                    },
+                });
+                push(@{$response->{handlers}{response_redirect}}, {
+                    callback => sub {
+                        my ($res, $ua, $handler, $data) = @_;
+                        my $refresh = $res->header('refresh') or return;
+                        my ($url) = $refresh =~ /;\s*url\s*=\s*['"]?([^"'>]+)/i
+                            or return;
+                        require HTML::Entities;
+                        HTML::Entities::decode($url);
+                        my $uri = URI->new_abs($url, $res->request->uri)->canonical;
+                        my $base = $res->request->uri;
+                        my $uri = $base->new_abs($url, $base);
+                        return if $uri == $base;
+                        return HTTP::Request->new(
+                            GET => $uri, [referer => $base]
+                        );
+                    },
+                });
             } : undef,
             m_media_type => "html",
         );
index e40f67a90bf0ea045d0e862798868fcf824f26fb..50894754750252b6b7c4dbdf5b0e18f259f44d19 100644 (file)
@@ -64,7 +64,7 @@ sub _test {
     return plan skip_all => 'We could not talk to our daemon' unless $DAEMON;
     return plan skip_all => 'No base URI' unless $base;
 
-    plan tests => 130;
+    plan tests => 136;
 
     my $ua = LWP::UserAgent->new;
     $ua->agent("Mozilla/0.01 " . $ua->agent);
@@ -230,6 +230,21 @@ sub _test {
         $res = $ua->request($req);
         isa_ok($res, 'HTTP::Response', 'redirect loop: good response object');
     }
+    { # meta refresh
+        my $req = HTTP::Request->new(GET => url("/meta_refresh", $base));
+        my $res = $ua->request($req);
+
+        ok($res->is_success, 'meta_refresh: is_success');
+        like($res->content, qr|/echo/meta_refresh|, 'meta_refresh: content good');
+        is($res->previous->code, 200, 'meta_refresh: code 200');
+        is($res->redirects, 1, 'meta_refresh redirect count: 1');
+
+        $ua->max_redirect(0);
+        $res = $ua->request($req);
+        is($res->redirects, 0, 'meta_refresh redirect loop: 0 redirects');
+        like($res->header("Client-Warning"), qr/loop detected/i, 'meta_refresh redirect loop: client warning');
+        $ua->max_redirect(5);
+    }
     { # basic auth
         my $req = HTTP::Request->new(GET => url("/basic", $base));
         my $res = MyUA->new->request($req);
@@ -645,6 +660,20 @@ sub daemonize {
     $router{get_redirect2} = sub { shift->send_redirect("/redirect3/") };
     $router{get_redirect3} = sub { shift->send_redirect("/redirect2/") };
     $router{get_redirect4} = sub { my $r = HTTP::Response->new(303); shift->send_response($r) };
+    $router{get_meta_refresh} = sub {
+        my($c,$r) = @_;
+        $c->send_basic_header;
+        $c->print("Content-Type: text/html");
+        $c->send_crlf;
+        $c->send_crlf;
+        $c->print(<<'        HTML');
+            <html>
+            <head>
+            <meta http-equiv='refresh' content='0; url=/echo/meta_refresh' />
+            </head>
+            </html>
+        HTML
+    };
     $router{post_echo} = sub {
         my($c,$r) = @_;
         $c->send_basic_header;
index bc88130b768df1b61d6c05eed3863a92cd0c04cb..67282bb666c4f676b5506f3409a63795af8ac805 100644 (file)
@@ -349,6 +349,7 @@ gong
 gopher
 gpeters
 granny
+grr
 haarg
 hfroehlich
 http
index 41450614c4d1584cdd5fb08e501c8c7d746ae5a1..99ed83748d78a30caa1ebf8ed690337784f241d7 100644 (file)
@@ -8,7 +8,7 @@ if (($ENV{TRAVIS_PULL_REQUEST} || '') eq 'false') {
 
 note 'Checking Changes';
 my $changes_file = 'Changes';
-my $newver = '6.62';
+my $newver = '6.63';
 my $trial_token = '-TRIAL';
 my $encoding = 'UTF-8';