Commit 28e3f41a authored by Xavier Guimard's avatar Xavier Guimard

New upstream version 6.15

parent 2f7835e6
......@@ -58,6 +58,7 @@ patches, bug reports, help with troubleshooting, etc. A huge
* Steve Hay
* Tatsuhiko Miyagawa
* Tatsuhiko Miyagawa
* Theo van Hoesel
* Tobias Leich
* Todd Lipcon
* tokuhirom
......
Revision history for HTTP-Message
6.15 2018-03-13 13:02:56Z
- Whenever possible, use an absolute four digit year for Time::Local (GH#97)
- Add is_cacheable_by_default() (GH#98) (Theo van Hoesel)
6.14 2017-12-20 22:28:48Z
- Add some useful examples in HTTP::Request (GH #92) (Chase Whitener).
Batch requests are now explained.
......
# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010.
# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.011.
CONTRIBUTORS
Changes
INSTALL
......
This diff is collapsed.
......@@ -14,7 +14,7 @@ configure_requires:
ExtUtils::MakeMaker: '0'
perl: '5.006'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010'
generated_by: 'Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -55,15 +55,15 @@ resources:
bugtracker: https://github.com/libwww-perl/HTTP-Message/issues
homepage: https://github.com/libwww-perl/HTTP-Message
repository: https://github.com/libwww-perl/HTTP-Message.git
version: '6.14'
version: '6.15'
x_Dist_Zilla:
perl:
version: '5.026000'
version: '5.026001'
plugins:
-
class: Dist::Zilla::Plugin::MetaResources
name: MetaResources
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::Prereqs
config:
......@@ -71,7 +71,7 @@ x_Dist_Zilla:
phase: runtime
type: requires
name: Prereqs
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
......@@ -100,11 +100,11 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::MAXMIND::TidyAll
name: '@Author::OALDERS/MAXMIND::TidyAll'
version: '0.82'
version: '0.13'
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: '@Author::OALDERS/AutoPrereqs'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::CheckChangesHasContent
name: '@Author::OALDERS/CheckChangesHasContent'
......@@ -115,11 +115,11 @@ x_Dist_Zilla:
Dist::Zilla::Role::TestRunner:
default_jobs: 1
name: '@Author::OALDERS/MakeMaker'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::CPANFile
name: '@Author::OALDERS/CPANFile'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::ContributorsFile
name: '@Author::OALDERS/ContributorsFile'
......@@ -127,31 +127,31 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@Author::OALDERS/MetaJSON'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@Author::OALDERS/MetaYAML'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::Manifest
name: '@Author::OALDERS/Manifest'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::MetaNoIndex
name: '@Author::OALDERS/MetaNoIndex'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@Author::OALDERS/MetaConfig'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::MetaResources
name: '@Author::OALDERS/MetaResources'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::License
name: '@Author::OALDERS/License'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::InstallGuide
name: '@Author::OALDERS/InstallGuide'
......@@ -159,7 +159,7 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::ExecDir
name: '@Author::OALDERS/ExecDir'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::Test::CPAN::Changes
config:
......@@ -170,7 +170,7 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::TestRelease
name: '@Author::OALDERS/TestRelease'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::Test::ReportPrereqs
name: '@Author::OALDERS/Test::ReportPrereqs'
......@@ -263,7 +263,7 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::PruneCruft
name: '@Author::OALDERS/PruneCruft'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::CopyFilesFromBuild
name: '@Author::OALDERS/CopyFilesFromBuild'
......@@ -320,7 +320,7 @@ x_Dist_Zilla:
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: 2.15.1
git_version: 2.16.2
repo_root: .
name: '@Author::OALDERS/Git::Check'
version: '2.043'
......@@ -328,7 +328,7 @@ x_Dist_Zilla:
class: Dist::Zilla::Plugin::Git::Contributors
config:
Dist::Zilla::Plugin::Git::Contributors:
git_version: 2.15.1
git_version: 2.16.2
include_authors: 0
include_releaser: 1
order_by: name
......@@ -345,7 +345,7 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::ShareDir
name: '@Author::OALDERS/ShareDir'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::TravisCI::StatusBadge
name: '@Author::OALDERS/TravisCI::StatusBadge'
......@@ -353,11 +353,11 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::ConfirmRelease
name: '@Author::OALDERS/ConfirmRelease'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@Author::OALDERS/UploadToCPAN'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::RewriteVersion::Transitional
config:
......@@ -370,11 +370,11 @@ x_Dist_Zilla:
skip_version_provider: 0
Dist::Zilla::Plugin::RewriteVersion::Transitional: {}
name: '@Author::OALDERS/@Git::VersionManager/RewriteVersion::Transitional'
version: '0.008'
version: '0.009'
-
class: Dist::Zilla::Plugin::MetaProvides::Update
name: '@Author::OALDERS/@Git::VersionManager/MetaProvides::Update'
version: '0.003'
version: '0.005'
-
class: Dist::Zilla::Plugin::CopyFilesFromRelease
config:
......@@ -403,7 +403,7 @@ x_Dist_Zilla:
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: 2.15.1
git_version: 2.16.2
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
......@@ -416,11 +416,11 @@ x_Dist_Zilla:
branch: ~
changelog: Changes
signed: 0
tag: v6.14
tag: v6.15
tag_format: v%v
tag_message: v%v
Dist::Zilla::Role::Git::Repo:
git_version: 2.15.1
git_version: 2.16.2
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
......@@ -437,11 +437,11 @@ x_Dist_Zilla:
munge_makefile_pl: 1
Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {}
name: '@Author::OALDERS/@Git::VersionManager/BumpVersionAfterRelease::Transitional'
version: '0.008'
version: '0.009'
-
class: Dist::Zilla::Plugin::NextRelease
name: '@Author::OALDERS/@Git::VersionManager/NextRelease'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
......@@ -457,7 +457,7 @@ x_Dist_Zilla:
- (?^:^lib/.*\.pm$)
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: 2.15.1
git_version: 2.16.2
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
......@@ -471,55 +471,55 @@ x_Dist_Zilla:
- origin
remotes_must_exist: 1
Dist::Zilla::Role::Git::Repo:
git_version: 2.15.1
git_version: 2.16.2
repo_root: .
name: '@Author::OALDERS/Git::Push'
version: '2.043'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExtraTestFiles'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':PerlExecFiles'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':AllFiles'
version: '6.010'
version: '6.011'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':NoFiles'
version: '6.010'
version: '6.011'
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: '0'
version: '6.010'
version: '6.011'
x_contributors:
- 'Adam Kennedy <adamk@cpan.org>'
- 'Adam Sjogren <asjo@koldfront.dk>'
......@@ -573,6 +573,7 @@ x_contributors:
- 'Steve Hay <SteveHay@planit.com>'
- 'Tatsuhiko Miyagawa <miyagawa@bulknews.net>'
- 'Tatsuhiko Miyagawa <miyagawa@gmail.com>'
- 'Theo van Hoesel <Th.J.v.Hoesel@THEMA-MEDIA.nl>'
- 'Tobias Leich <email@froggs.de>'
- 'Todd Lipcon <todd@amiestreet.com>'
- 'tokuhirom <tokuhirom@gmail.com>'
......
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.010.
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.011.
use strict;
use warnings;
......@@ -48,7 +48,7 @@ my %WriteMakefileArgs = (
"Time::Local" => 0,
"Try::Tiny" => 0
},
"VERSION" => "6.14",
"VERSION" => "6.15",
"test" => {
"TESTS" => "t/*.t"
}
......
......@@ -4,7 +4,7 @@ HTTP::Message - HTTP style message (base class)
# VERSION
version 6.14
version 6.15
# SYNOPSIS
......
......@@ -3,7 +3,7 @@ package HTTP::Config;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
use URI;
......@@ -245,7 +245,7 @@ HTTP::Config - Configuration for request and response objects
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......
......@@ -3,7 +3,7 @@ package HTTP::Headers;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
use Carp ();
......@@ -475,7 +475,7 @@ HTTP::Headers - Class encapsulating HTTP Message headers
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......
......@@ -3,7 +3,7 @@ package HTTP::Headers::Auth;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
use HTTP::Headers;
......@@ -111,7 +111,7 @@ HTTP::Headers::Auth
=head1 VERSION
version 6.14
version 6.15
=head1 AUTHOR
......
......@@ -3,7 +3,7 @@ package HTTP::Headers::ETag;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
require HTTP::Date;
......@@ -107,7 +107,7 @@ HTTP::Headers::ETag
=head1 VERSION
version 6.14
version 6.15
=head1 AUTHOR
......
......@@ -3,7 +3,7 @@ package HTTP::Headers::Util;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
use base 'Exporter';
......@@ -103,7 +103,7 @@ HTTP::Headers::Util - Header value parsing utility functions
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......
......@@ -3,7 +3,7 @@ package HTTP::Message;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
require HTTP::Headers;
require Carp;
......@@ -781,7 +781,7 @@ HTTP::Message - HTTP style message (base class)
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......
......@@ -3,7 +3,7 @@ package HTTP::Request;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
use base 'HTTP::Message';
......@@ -145,7 +145,7 @@ HTTP::Request - HTTP style request message
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......
......@@ -3,7 +3,7 @@ package HTTP::Request::Common;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
our $DYNAMIC_FILE_UPLOAD ||= 0; # make it defined (don't know why)
......@@ -312,7 +312,7 @@ HTTP::Request::Common - Construct common HTTP::Request objects
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......
......@@ -3,7 +3,7 @@ package HTTP::Response;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
use base 'HTTP::Message';
......@@ -351,7 +351,7 @@ HTTP::Response - HTTP style response message
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......
......@@ -3,13 +3,13 @@ package HTTP::Status;
use strict;
use warnings;
our $VERSION = '6.14';
our $VERSION = '6.15';
require 5.002; # because we use prototypes
use base 'Exporter';
our @EXPORT = qw(is_info is_success is_redirect is_error status_message);
our @EXPORT_OK = qw(is_client_error is_server_error);
our @EXPORT_OK = qw(is_client_error is_server_error is_cacheable_by_default);
# Note also addition of mnemonics to @EXPORT below
......@@ -105,12 +105,25 @@ our %EXPORT_TAGS = (
sub status_message ($) { $StatusCode{$_[0]}; }
sub is_info ($) { $_[0] && $_[0] >= 100 && $_[0] < 200; }
sub is_success ($) { $_[0] && $_[0] >= 200 && $_[0] < 300; }
sub is_redirect ($) { $_[0] && $_[0] >= 300 && $_[0] < 400; }
sub is_error ($) { $_[0] && $_[0] >= 400 && $_[0] < 600; }
sub is_client_error ($) { $_[0] && $_[0] >= 400 && $_[0] < 500; }
sub is_server_error ($) { $_[0] && $_[0] >= 500 && $_[0] < 600; }
sub is_info ($) { $_[0] && $_[0] >= 100 && $_[0] < 200; }
sub is_success ($) { $_[0] && $_[0] >= 200 && $_[0] < 300; }
sub is_redirect ($) { $_[0] && $_[0] >= 300 && $_[0] < 400; }
sub is_error ($) { $_[0] && $_[0] >= 400 && $_[0] < 600; }
sub is_client_error ($) { $_[0] && $_[0] >= 400 && $_[0] < 500; }
sub is_server_error ($) { $_[0] && $_[0] >= 500 && $_[0] < 600; }
sub is_cacheable_by_default ($) { $_[0] &&
( $_[0] == 200 # OK
|| $_[0] == 203 # Non-Authoritative Information
|| $_[0] == 204 # No Content
|| $_[0] == 206 # Not Acceptable
|| $_[0] == 300 # Multiple Choices
|| $_[0] == 301 # Moved Permanently
|| $_[0] == 404 # Not Found
|| $_[0] == 405 # Method Not Allowed
|| $_[0] == 410 # Gone
|| $_[0] == 414 # Request-URI Too Large
|| $_[0] == 501 # Not Implemented
); }
1;
......@@ -124,7 +137,7 @@ HTTP::Status - HTTP Status code processing
=head1 VERSION
version 6.14
version 6.15
=head1 SYNOPSIS
......@@ -267,6 +280,15 @@ that it has erred or is incapable of performing the request.
This function is B<not> exported by default.
=item is_cacheable_by_default( $code )
Return TRUE if C<$code> indicates that a response is cacheable by default, and
it can be reused by a cache with heuristic expiration. All other status codes
are not cacheable by default. See L<RFC 7231 - HTTP/1.1 Semantics and Content,
Section 6.1. Overview of Status Codes|https://tools.ietf.org/html/rfc7231#section-6.1>.
This function is B<not> exported by default.
=back
=head1 BUGS
......
......@@ -13,7 +13,7 @@ require HTTP::Request;
require HTTP::Response;
require Time::Local if $^O eq "MacOS";
my $offset = ($^O eq "MacOS") ? Time::Local::timegm(0,0,0,1,0,70) : 0;
my $offset = ($^O eq "MacOS") ? Time::Local::timegm(0,0,0,1,0,1970) : 0;
my $req = HTTP::Request->new(GET => "http://www.sn.no/");
$req->header(
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
use Test::More;
plan tests => 20;
plan tests => 36;
use HTTP::Status qw(:constants :is status_message);
......@@ -30,3 +30,11 @@ ok(!is_server_error(999));
ok(!is_info(99));
ok(!is_success(99));
ok(!is_redirect(99));
ok(is_cacheable_by_default($_),
"Cacheable by default [$_] " . status_message($_)
) for (200,203,204,206,300,301,404,405,410,414,501);
ok(!is_cacheable_by_default($_),
"... is not cacheable [$_] " . status_message($_)
) for (100,201,302,400,500);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment