Thank you for considering contributing to this distribution. This file
contains instructions that will help you work with the source code.
+PLEASE NOTE that if you have any questions or difficulties, you can reach the
+maintainer(s) through the bug queue described later in this document
+(preferred), or by emailing the releaser directly. You are not required to
+follow any of the steps in this document to submit a patch or bug report;
+these are just recommendations, intended to help you (and help us help you
+faster).
+
The distribution is managed with [Dist::Zilla](https://metacpan.org/pod/Dist::Zilla).
This means that many of the usual files you might expect are not in the
repository, but are generated at release time. Some generated files are kept
$ prove -l
$ prove -lv t/some_test_file.t
-For most of my distributions, `prove` is entirely sufficient for you to test
-any patches you have. I use `prove` for 99% of my testing during development.
+In most cases, `prove` is entirely sufficient for you to test any patches you
+have. I use `prove` for 99% of my testing during development.
## Code style and tidying
Please try to match any existing coding style. If there is a `.perltidyrc`
file, please install Perl::Tidy and use perltidy before submitting patches.
+## Submitting patches
+
+The code for this distribution is hosted at GitHub. The repository is:
+https://github.com/libwww-perl/libwww-perl
+You can submit code changes by forking the repository, pushing your code
+changes to your clone, and then submitting a pull request. Detailed
+instructions for doing that is available here:
+
+https://help.github.com/articles/creating-a-pull-request
+
+All pull requests for this distribution will be automatically tested on Linux
+by Travis at: https://travis-ci.com/libwww-perl/libwww-perl
+Results will be visible in the pull request on GitHub. Follow the appropriate
+links for details when tests fail.
+
+If you have found a bug, but do not have an accompanying patch to fix it, you
+can submit an issue report here:
+https://rt.cpan.org/Public/Dist/Display.html?Name=libwww-perl
+or via email: bug-libwww-perl@rt.cpan.org
+
+There is also a mailing list available for users of this distribution, at
+libwww@perl.org
+There is also an irc channel available for users of this distribution, at
+irc://irc.perl.org/#lwp
+
## Installing and using Dist::Zilla
[Dist::Zilla](https://metacpan.org/pod/Dist::Zilla) is a very powerful
Change history for libwww-perl
+6.37 2019-03-06 20:49:26Z
+ - Improve ->add_handler documentation (GH #272) (Julien Fiegehenn)
+ - Alter our rule set to allow IPv6 proxy hosts beginning with [. (GH #237)
+ - Add a jigsaw test for 307 redirects (GH#285) (Nik LaBelle)
+
6.36 2018-10-10 02:20:58Z
- fix broken link https://metacpan.org/pod/LWP::Simple by fixing pod
header (thanks for the report, traumschule!)
"configure_requires" key of META.yml or the
"{prereqs}{configure}{requires}" key of META.json.
+## Other Prerequisites
+
+This distribution may require additional modules to be installed after running
+Makefile.PL.
+Look for prerequisites in the following phases:
+
+* to run make, PHASE = build
+* to use the module code itself, PHASE = runtime
+* to run tests, PHASE = test
+
+They can all be found in the "PHASE_requires" key of MYMETA.yml or the
+"{prereqs}{PHASE}{requires}" key of MYMETA.json.
+
## Documentation
libwww-perl documentation is available as POD.
xt/author/live/jigsaw/md5.t
xt/author/live/jigsaw/neg-get.t
xt/author/live/jigsaw/neg.t
+xt/author/live/jigsaw/redirect-post.t
xt/author/live/jigsaw/te.t
xt/author/live/online.t
xt/author/minimum-version.t
xt/author/misc/dbmrobot
xt/author/misc/get-callback
xt/author/misc/get-file
-xt/author/misc/pod.t
xt/author/mojibake.t
xt/author/net/cache-timeouts.t
xt/author/net/cgi-bin/moved
"provides" : {
"LWP" : {
"file" : "lib/LWP.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Authen::Basic" : {
"file" : "lib/LWP/Authen/Basic.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Authen::Digest" : {
"file" : "lib/LWP/Authen/Digest.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Authen::Ntlm" : {
"file" : "lib/LWP/Authen/Ntlm.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::ConnCache" : {
"file" : "lib/LWP/ConnCache.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Debug" : {
"file" : "lib/LWP/Debug.pm",
- "version" : "6.36",
+ "version" : "6.37",
"x_deprecated" : 1
},
"LWP::Debug::TraceHTTP" : {
"file" : "lib/LWP/Debug/TraceHTTP.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::DebugFile" : {
"file" : "lib/LWP/DebugFile.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::MemberMixin" : {
"file" : "lib/LWP/MemberMixin.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol" : {
"file" : "lib/LWP/Protocol.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::cpan" : {
"file" : "lib/LWP/Protocol/cpan.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::data" : {
"file" : "lib/LWP/Protocol/data.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::file" : {
"file" : "lib/LWP/Protocol/file.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::ftp" : {
"file" : "lib/LWP/Protocol/ftp.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::gopher" : {
"file" : "lib/LWP/Protocol/gopher.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::http" : {
"file" : "lib/LWP/Protocol/http.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::loopback" : {
"file" : "lib/LWP/Protocol/loopback.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::mailto" : {
"file" : "lib/LWP/Protocol/mailto.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::nntp" : {
"file" : "lib/LWP/Protocol/nntp.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Protocol::nogo" : {
"file" : "lib/LWP/Protocol/nogo.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::RobotUA" : {
"file" : "lib/LWP/RobotUA.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::Simple" : {
"file" : "lib/LWP/Simple.pm",
- "version" : "6.36"
+ "version" : "6.37"
},
"LWP::UserAgent" : {
"file" : "lib/LWP/UserAgent.pm",
- "version" : "6.36"
+ "version" : "6.37"
}
},
"release_status" : "stable",
"x_IRC" : "irc://irc.perl.org/#lwp",
"x_MailingList" : "mailto:libwww@perl.org"
},
- "version" : "6.36",
+ "version" : "6.37",
"x_Dist_Zilla" : {
"perl" : {
- "version" : "5.029003"
+ "version" : "5.026001"
},
"plugins" : [
{
"meta_noindex" : 1
},
"Dist::Zilla::Role::ModuleMetadata" : {
- "Module::Metadata" : "1.000034",
- "version" : "0.006"
+ "Module::Metadata" : "1.000033",
+ "version" : "0.004"
}
},
"name" : "MetaProvides::Package",
"class" : "Dist::Zilla::Plugin::Git::Contributors",
"config" : {
"Dist::Zilla::Plugin::Git::Contributors" : {
- "git_version" : "2.18.0",
+ "git_version" : "2.20.1",
"include_authors" : 0,
"include_releaser" : 1,
"order_by" : "name",
{
"class" : "Dist::Zilla::Plugin::InstallGuide",
"name" : "InstallGuide",
- "version" : "1.200011"
+ "version" : "1.200012"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
"class" : "Dist::Zilla::Plugin::DynamicPrereqs",
"config" : {
"Dist::Zilla::Role::ModuleMetadata" : {
- "Module::Metadata" : "1.000034",
- "version" : "0.006"
+ "Module::Metadata" : "1.000033",
+ "version" : "0.004"
}
},
"name" : "DynamicPrereqs",
}
},
"name" : "MakeMaker::Awesome",
- "version" : "0.47"
+ "version" : "0.41"
},
{
"class" : "Dist::Zilla::Plugin::MojibakeTests",
"name" : "Test::Compile",
"version" : "2.058"
},
+ {
+ "class" : "Dist::Zilla::Plugin::Substitute",
+ "name" : "00-compile.t",
+ "version" : "0.006"
+ },
{
"class" : "Dist::Zilla::Plugin::Test::Portability",
"config" : {
},
{
"class" : "Dist::Zilla::Plugin::Substitute",
- "name" : "Substitute",
+ "name" : "changes_has_content.t",
"version" : "0.006"
},
{
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
- "git_version" : "2.18.0",
+ "git_version" : "2.20.1",
"repo_root" : "."
}
},
}
},
"name" : "CopyFilesFromRelease",
- "version" : "0.007"
+ "version" : "0.006"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
}
},
"name" : "@Git::VersionManager/CopyFilesFromRelease",
- "version" : "0.007"
+ "version" : "0.006"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
- "git_version" : "2.18.0",
+ "git_version" : "2.20.1",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"branch" : null,
"changelog" : "Changes",
"signed" : 0,
- "tag" : "v6.36",
+ "tag" : "v6.37",
"tag_format" : "v%v",
"tag_message" : "v%v"
},
"Dist::Zilla::Role::Git::Repo" : {
- "git_version" : "2.18.0",
+ "git_version" : "2.20.1",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
- "git_version" : "2.18.0",
+ "git_version" : "2.20.1",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"remotes_must_exist" : 1
},
"Dist::Zilla::Role::Git::Repo" : {
- "git_version" : "2.18.0",
+ "git_version" : "2.20.1",
"repo_root" : "."
}
},
"murphy <murphy@genome.chop.edu>",
"Naveed Massjouni <naveedm9@gmail.com>",
"Nigel Gregoire <nigelgregoire@gmail.com>",
+ "Nik LaBelle <nalabelle@gmail.com>",
"Olaf Alders <olaf@wundersolutions.com>",
"Ondrej Hanak <ondrej.hanak@ubs.com>",
"Patrik Lundin <patrik.lundin@su.se>",
"Sean M. Burke <sburke@cpan.org>",
"Sergey Romanov <sromanov-dev@yandex.ru>",
"Shoichi Kaji <skaji@cpan.org>",
+ "simbabque <simbabque@cpan.org>",
"Slaven Rezic <slaven@rezic.de>",
"Spiros Denaxas <s.denaxas@gmail.com>",
"Steffen Ullrich <Steffen_Ullrich@genua.de>",
"Yury Zavarin <yury.zavarin@gmail.com>",
"Zefram <zefram@fysh.org>"
],
- "x_generated_by_perl" : "v5.29.3",
- "x_serialization_backend" : "Cpanel::JSON::XS version 4.06"
+ "x_generated_by_perl" : "v5.26.1",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.04"
}
provides:
LWP:
file: lib/LWP.pm
- version: '6.36'
+ version: '6.37'
LWP::Authen::Basic:
file: lib/LWP/Authen/Basic.pm
- version: '6.36'
+ version: '6.37'
LWP::Authen::Digest:
file: lib/LWP/Authen/Digest.pm
- version: '6.36'
+ version: '6.37'
LWP::Authen::Ntlm:
file: lib/LWP/Authen/Ntlm.pm
- version: '6.36'
+ version: '6.37'
LWP::ConnCache:
file: lib/LWP/ConnCache.pm
- version: '6.36'
+ version: '6.37'
LWP::Debug:
file: lib/LWP/Debug.pm
- version: '6.36'
+ version: '6.37'
x_deprecated: 1
LWP::Debug::TraceHTTP:
file: lib/LWP/Debug/TraceHTTP.pm
- version: '6.36'
+ version: '6.37'
LWP::DebugFile:
file: lib/LWP/DebugFile.pm
- version: '6.36'
+ version: '6.37'
LWP::MemberMixin:
file: lib/LWP/MemberMixin.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol:
file: lib/LWP/Protocol.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::cpan:
file: lib/LWP/Protocol/cpan.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::data:
file: lib/LWP/Protocol/data.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::file:
file: lib/LWP/Protocol/file.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::ftp:
file: lib/LWP/Protocol/ftp.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::gopher:
file: lib/LWP/Protocol/gopher.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::http:
file: lib/LWP/Protocol/http.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::loopback:
file: lib/LWP/Protocol/loopback.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::mailto:
file: lib/LWP/Protocol/mailto.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::nntp:
file: lib/LWP/Protocol/nntp.pm
- version: '6.36'
+ version: '6.37'
LWP::Protocol::nogo:
file: lib/LWP/Protocol/nogo.pm
- version: '6.36'
+ version: '6.37'
LWP::RobotUA:
file: lib/LWP/RobotUA.pm
- version: '6.36'
+ version: '6.37'
LWP::Simple:
file: lib/LWP/Simple.pm
- version: '6.36'
+ version: '6.37'
LWP::UserAgent:
file: lib/LWP/UserAgent.pm
- version: '6.36'
+ version: '6.37'
requires:
Digest::MD5: '0'
Encode: '2.12'
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.36'
+version: '6.37'
x_Dist_Zilla:
perl:
- version: '5.029003'
+ version: '5.026001'
plugins:
-
class: Dist::Zilla::Plugin::Git::GatherDir
inherit_version: '1'
meta_noindex: '1'
Dist::Zilla::Role::ModuleMetadata:
- Module::Metadata: '1.000034'
- version: '0.006'
+ Module::Metadata: '1.000033'
+ version: '0.004'
name: MetaProvides::Package
version: '2.004003'
-
class: Dist::Zilla::Plugin::Git::Contributors
config:
Dist::Zilla::Plugin::Git::Contributors:
- git_version: 2.18.0
+ git_version: 2.20.1
include_authors: 0
include_releaser: 1
order_by: name
-
class: Dist::Zilla::Plugin::InstallGuide
name: InstallGuide
- version: '1.200011'
+ version: '1.200012'
-
class: Dist::Zilla::Plugin::ExecDir
name: ExecDir
class: Dist::Zilla::Plugin::DynamicPrereqs
config:
Dist::Zilla::Role::ModuleMetadata:
- Module::Metadata: '1.000034'
- version: '0.006'
+ Module::Metadata: '1.000033'
+ version: '0.004'
name: DynamicPrereqs
version: '0.034'
-
default_jobs: 1
version: '6.012'
name: MakeMaker::Awesome
- version: '0.47'
+ version: '0.41'
-
class: Dist::Zilla::Plugin::MojibakeTests
name: MojibakeTests
switch: []
name: Test::Compile
version: '2.058'
+ -
+ class: Dist::Zilla::Plugin::Substitute
+ name: 00-compile.t
+ version: '0.006'
-
class: Dist::Zilla::Plugin::Test::Portability
config:
version: '0.011'
-
class: Dist::Zilla::Plugin::Substitute
- name: Substitute
+ name: changes_has_content.t
version: '0.006'
-
class: Dist::Zilla::Plugin::Test::MinimumVersion
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
- git_version: 2.18.0
+ git_version: 2.20.1
repo_root: .
name: Git::Check
version: '2.045'
- META.json
match: []
name: CopyFilesFromRelease
- version: '0.007'
+ version: '0.006'
-
class: Dist::Zilla::Plugin::Prereqs
config:
- Changes
match: []
name: '@Git::VersionManager/CopyFilesFromRelease'
- version: '0.007'
+ version: '0.006'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
- git_version: 2.18.0
+ git_version: 2.20.1
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
branch: ~
changelog: Changes
signed: 0
- tag: v6.36
+ tag: v6.37
tag_format: v%v
tag_message: v%v
Dist::Zilla::Role::Git::Repo:
- git_version: 2.18.0
+ git_version: 2.20.1
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
- (?^:^lib/.*\.pm$)
changelog: Changes
Dist::Zilla::Role::Git::Repo:
- git_version: 2.18.0
+ git_version: 2.20.1
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
- origin
remotes_must_exist: 1
Dist::Zilla::Role::Git::Repo:
- git_version: 2.18.0
+ git_version: 2.20.1
repo_root: .
name: Git::Push
version: '2.045'
- 'murphy <murphy@genome.chop.edu>'
- 'Naveed Massjouni <naveedm9@gmail.com>'
- 'Nigel Gregoire <nigelgregoire@gmail.com>'
+ - 'Nik LaBelle <nalabelle@gmail.com>'
- 'Olaf Alders <olaf@wundersolutions.com>'
- 'Ondrej Hanak <ondrej.hanak@ubs.com>'
- 'Patrik Lundin <patrik.lundin@su.se>'
- 'Sean M. Burke <sburke@cpan.org>'
- 'Sergey Romanov <sromanov-dev@yandex.ru>'
- 'Shoichi Kaji <skaji@cpan.org>'
+ - 'simbabque <simbabque@cpan.org>'
- 'Slaven Rezic <slaven@rezic.de>'
- 'Spiros Denaxas <s.denaxas@gmail.com>'
- 'Steffen Ullrich <Steffen_Ullrich@genua.de>'
- 'Yuri Karaban <tech@askold.net>'
- 'Yury Zavarin <yury.zavarin@gmail.com>'
- 'Zefram <zefram@fysh.org>'
-x_generated_by_perl: v5.29.3
-x_serialization_backend: 'YAML::Tiny version 1.73'
+x_generated_by_perl: v5.26.1
+x_serialization_backend: 'YAML::Tiny version 1.70'
# This Makefile.PL for libwww-perl was generated by
-# Dist::Zilla::Plugin::MakeMaker::Awesome 0.47.
+# Dist::Zilla::Plugin::MakeMaker::Awesome 0.41.
# Don't edit it but the dist.ini and plugins used to construct it.
use strict;
"Test::Needs" => 0,
"Test::RequiresInternet" => 0
},
- "VERSION" => "6.36",
+ "VERSION" => "6.37",
"test" => {
"TESTS" => "t/*.t t/base/*.t t/base/protocols/*.t t/leak/*.t t/local/*.t t/robot/*.t"
}
# 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;
[MojibakeTests]
[Test::Version]
[Test::ReportPrereqs]
+
[Test::Compile]
bail_out_on_fail = 1
xt_mode = 1
+; avoid failing on 5.8: Warning: Use of "keys" without parentheses is ambiguous at Data/Dump/Trace.pm line 262.
+[Substitute / 00-compile.t]
+file = xt/author/00-compile.t
+code = s{(is\(scalar\(\@warnings\), 0, 'no warnings found'\))}{TODO: \{\nlocal \$TODO = 'Data::Dump::Trace warns on 5.8' if \$\] < '5.009';\n$1};
+code = s{(^\s+or diag 'got warnings: ', explain\(\\\@warnings\);)}{$1\n\}};
[Test::Portability]
; TODO perltidy for NoTabs and namespace::autoclean
; [Test::CleanNamespaces] ; TODO
; [Test::NoTabs] ; TODO
[Test::EOL]
+
+; We run release tests in travis. but make the changes-has-content test TODO only for master.
+; This will prod pull request submitters to add a Changes entry.
[Test::ChangesHasContent]
-[Substitute]
+[Substitute / changes_has_content.t]
file = xt/release/changes_has_content.t
code = s{^(note 'Checking Changes')}{if \(\(\$ENV\{TRAVIS_PULL_REQUEST\} \|\| '') eq 'false'\) \{\n chomp\(my \$branch_name = \(\$ENV\{TRAVIS_BRANCH\} || \`git rev-parse --abbrev-ref HEAD\`\)\);\n \$TODO = 'Changes need not have content for this release yet if this is only the master branch'\n if \(\$branch_name \|\| ''\) eq 'master';\n\}\n\n$1}
package LWP;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require LWP::UserAgent; # this should load everything you need
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require MIME::Base64;
use strict;
use base 'LWP::Authen::Basic';
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require Digest::MD5;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
use Authen::NTLM "1.02";
use MIME::Base64 "2.12";
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
our $DEBUG;
sub new {
package LWP::Debug; # legacy
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require Exporter;
our @ISA = qw(Exporter);
use strict;
use base 'LWP::Protocol::http';
-our $VERSION = '6.36';
+our $VERSION = '6.37';
package # hide from PAUSE
LWP::Debug::TraceHTTP::Socket;
package LWP::DebugFile;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
# legacy stub
package LWP::MemberMixin;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
sub _elem {
my $self = shift;
use base 'LWP::MemberMixin';
-our $VERSION = '6.36';
+our $VERSION = '6.37';
use strict;
use Carp ();
use base qw(LWP::Protocol);
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require URI;
require HTTP::Status;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require HTTP::Response;
require HTTP::Status;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require LWP::MediaTypes;
require HTTP::Request;
use base qw(LWP::Protocol);
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
use Carp ();
use HTTP::Status ();
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require HTTP::Response;
require HTTP::Status;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require HTTP::Response;
require HTTP::Status;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require HTTP::Response;
use Carp;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
use base qw(LWP::Protocol);
our $SENDMAIL;
use base qw(LWP::Protocol);
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require HTTP::Response;
require HTTP::Status;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require HTTP::Response;
require HTTP::Status;
use base qw(LWP::UserAgent);
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require WWW::RobotRules;
require HTTP::Request;
use strict;
-our $VERSION = '6.36';
+our $VERSION = '6.37';
require Exporter;
use Scalar::Util qw(blessed);
use Try::Tiny qw(try catch);
-our $VERSION = '6.36';
+our $VERSION = '6.37';
sub new
{
my $url = shift;
if (defined($url) && length($url)) {
Carp::croak("Proxy must be specified as absolute URI; '$url' is not") unless $url =~ /^$URI::scheme_re:/;
- Carp::croak("Bad http proxy specification '$url'") if $url =~ /^https?:/ && $url !~ m,^https?://\w,;
+ Carp::croak("Bad http proxy specification '$url'") if $url =~ /^https?:/ && $url !~ m,^https?://[\w[],;
}
$self->{proxy}{$key} = $url;
$self->set_my_handler("request_preprepare", \&_need_proxy)
=over
-=item response_data => sub { my($response, $ua, $h, $data) = @_; ... }
+=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, $h) = @_; ... }
+=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_header => sub { my($response, $ua, $h) = @_; ... }
+=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 $response->{default_add_content} value to
+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 $ua->request() method
-was called with a $content_file or $content_cb argument; otherwise true.
+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 request_prepare => sub { my($request, $ua, $h) = @_; ... }
+=item request_prepare => sub { my($request, $ua, $handler) = @_; ... }
The handler is called before the request is sent and can modify the
request any way it see fit. This can for instance be used to add
certain headers to specific requests.
-The method can assign a new request object to $_[0] to replace the
+The method can assign a new request object to C<$_[0]> to replace the
request that is sent fully.
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, $h) = @_; ... }
+=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
initialization should take place here; but in general don't register
handlers for this phase.
-=item request_send => sub { my($request, $ua, $h) = @_; ... }
+=item request_send => sub { my($request, $ua, $handler) = @_; ... }
This handler gets a chance of handling requests before they're sent to the
-protocol handlers. It should return an HTTP::Response object if it
+protocol handlers. It should return an L<HTTP::Response> object if it
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_redirect => sub { my($response, $ua, $h) = @_; ... }
+=item response_redirect => sub { my($response, $ua, $handler) = @_; ... }
-The handler is called in $ua->request after C<response_done>. If the
-handler returns an HTTP::Request object we'll start over with processing
+The handler is called in C<< $ua->request >> after C<response_done>. If the
+handler returns an L<HTTP::Request> object we'll start over with processing
this request instead.
=back
+For all of these, C<$handler> is a code reference to the handler that
+is currently being run.
+
=head2 get_my_handler
$ua->get_my_handler( $phase, %matchspec );
my $ua = LWP::UserAgent->new;
$ua->add_handler(
request_send => sub {
- my ($request, $ua, $h) = @_;
+ my ($request, $ua, $handler) = @_;
return HTTP::Response->new(200,'OK',[],'ok');
}
);
+TODO: {
+local $TODO = 'Data::Dump::Trace warns on 5.8' if $] < '5.009';
is(scalar(@warnings), 0, 'no warnings found')
or diag 'got warnings: ', explain(\@warnings);
+}
BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing;
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+use Test::RequiresInternet ('jigsaw.w3.org' => 80);
+
+use HTTP::Request;
+use LWP::UserAgent;
+use JSON::PP qw(encode_json);
+use Encode qw(encode_utf8);
+
+plan tests => 10;
+
+my $ua = LWP::UserAgent->new(keep_alive => 1);
+
+my $data = {foo => 'bar', baz => 'quux'};
+my $encoded_data = encode_utf8(encode_json($data));
+
+# 307 not redirectable.
+my $req = HTTP::Request->new('POST', "http://jigsaw.w3.org/HTTP/300/Go_307", undef, undef);
+my $res = $ua->request($req);
+isa_ok($res, 'HTTP::Response', 'request: Got a proper response');
+is($res->code, 307, 'Got a 307 response');
+
+push @{ $ua->requests_redirectable }, 'POST';
+
+# POST can redirect, so support 307 (post to redirected location)
+$res = $ua->request($req);
+isa_ok($res, 'HTTP::Response', 'request: POST redirect got a proper response');
+my $uri = $res->request->uri->as_string;
+my $content = $res->content;
+
+# first we POST to 307
+unlike($uri, qr/Go_307/, 'POST to 307 endpoint was a POST');
+unlike($content, qr/GET not implemented/, 'response was not a GET');
+
+# we get redirected to 303
+unlike($uri, qr/Go_303/, 'POST to 303 endpoint was a POST');
+unlike($content, qr/GET not implemented/, 'response was not a GET');
+
+# Go_303 returns a 303 header, so we must GET the redirected location here
+like($uri, qr/303_ok\.html/, 'redirected to the correct page');
+unlike($content, qr/POST not allowed on this resource/, '303 OK endpoint was not a POST');
+like($content, qr/Your browser made it!/, 'response shows that we followed a 307 POST redirect and then a 303 GET redirect');
+++ /dev/null
-use strict;
-use warnings;
-
-use Test::More;
-
-plan skip_all => "Test::Pod 1.00 required for testing POD" unless eval 'use Test::Pod 1.00; 1';
-
-all_pod_files_ok();
Kubb
König
LWP
+LaBelle
Laker
Langfeldt
Langheinrich
Nicolai
Nierstrasz
Nigel
+Nik
Ntlm
Olaf
Olly
michiel
mmcleric
murphy
+nalabelle
naveedm9
nawglan
nigelgregoire
schwern
shaohua
shildreth
+simbabque
skaji
slaven
sprout
note 'Checking Changes';
my $changes_file = 'Changes';
-my $newver = '6.36';
+my $newver = '6.37';
my $trial_token = '-TRIAL';
my $encoding = 'UTF-8';