HTTP-Message-6.22/ 000755 000765 000024 00000000000 13625016310 015060 5 ustar 00olafalders staff 000000 000000 HTTP-Message-6.22/perltidyrc 000644 000765 000024 00000000330 13625016310 017160 0 ustar 00olafalders staff 000000 000000 --blank-lines-before-packages=0
--iterations=2
--no-outdent-long-comments
-b
-bar
-boc
-ci=4
-i=4
-l=78
-nolq
-se
-wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
HTTP-Message-6.22/perlcriticrc 000644 000765 000024 00000004405 13625016310 017473 0 ustar 00olafalders staff 000000 000000 severity = 3
verbose = 11
theme = core + pbp + bugs + maintenance + cosmetic + complexity + security + tests + moose
exclude = Subroutines::ProhibitCallsToUndeclaredSubs
[BuiltinFunctions::ProhibitStringySplit]
severity = 3
[CodeLayout::RequireTrailingCommas]
severity = 3
[ControlStructures::ProhibitCStyleForLoops]
severity = 3
[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = sleep
severity = 3
[Moose::RequireCleanNamespace]
modules = Moose Moose::Role MooseX::Role::Parameterized Moose::Util::TypeConstraints
cleaners = namespace::autoclean
[NamingConventions::Capitalization]
package_exemptions = [A-Z]\w+|minFraud
file_lexical_variables = [A-Z]\w+|[^A-Z]+
global_variables = :starts_with_upper
scoped_lexical_variables = [A-Z]\w+|[^A-Z]+
severity = 3
# Given our code base, leaving this at 5 would be a huge pain
[Subroutines::ProhibitManyArgs]
max_arguments = 10
[RegularExpressions::ProhibitComplexRegexes]
max_characters = 200
[RegularExpressions::ProhibitUnusualDelimiters]
severity = 3
[Subroutines::ProhibitUnusedPrivateSubroutines]
private_name_regex = _(?!build)\w+
skip_when_using = Moo::Role Moose::Role MooseX::Role::Parameterized Role::Tiny Test::Class::Moose::Role
[TestingAndDebugging::ProhibitNoWarnings]
allow = redefine
[ValuesAndExpressions::ProhibitEmptyQuotes]
severity = 3
[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
severity = 3
[ValuesAndExpressions::RequireUpperCaseHeredocTerminator]
severity = 3
[Variables::ProhibitPackageVars]
add_packages = Test::Builder
[TestingAndDebugging::RequireUseStrict]
[TestingAndDebugging::RequireUseWarnings]
[-ControlStructures::ProhibitCascadingIfElse]
[-ErrorHandling::RequireCarping]
[-InputOutput::RequireBriefOpen]
[-ValuesAndExpressions::ProhibitConstantPragma]
# No need for /xsm everywhere
[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireExtendedFormatting]
[-RegularExpressions::RequireLineBoundaryMatching]
[-Subroutines::ProhibitExplicitReturnUndef]
# http://stackoverflow.com/questions/2275317/why-does-perlcritic-dislike-using-shift-to-populate-subroutine-variables
[-Subroutines::RequireArgUnpacking]
[-Subroutines::RequireFinalReturn]
# "use v5.14" is more readable than "use 5.014"
[-ValuesAndExpressions::ProhibitVersionStrings]
HTTP-Message-6.22/cpanfile 000644 000765 000024 00000003173 13625016310 016570 0 ustar 00olafalders staff 000000 000000 requires "Carp" => "0";
requires "Compress::Raw::Zlib" => "0";
requires "Encode" => "3.01";
requires "Encode::Locale" => "1";
requires "Exporter" => "5.57";
requires "HTTP::Date" => "6";
requires "IO::Compress::Bzip2" => "2.021";
requires "IO::Compress::Deflate" => "0";
requires "IO::Compress::Gzip" => "0";
requires "IO::HTML" => "0";
requires "IO::Uncompress::Bunzip2" => "2.021";
requires "IO::Uncompress::Gunzip" => "0";
requires "IO::Uncompress::Inflate" => "0";
requires "IO::Uncompress::RawInflate" => "0";
requires "LWP::MediaTypes" => "6";
requires "MIME::Base64" => "2.1";
requires "MIME::QuotedPrint" => "0";
requires "Storable" => "0";
requires "URI" => "1.10";
requires "base" => "0";
requires "perl" => "5.008001";
requires "strict" => "0";
requires "warnings" => "0";
on 'test' => sub {
requires "ExtUtils::MakeMaker" => "0";
requires "File::Spec" => "0";
requires "PerlIO::encoding" => "0";
requires "Test::More" => "0.88";
requires "Time::Local" => "0";
requires "Try::Tiny" => "0";
requires "perl" => "5.008001";
};
on 'test' => sub {
recommends "CPAN::Meta" => "2.120900";
};
on 'configure' => sub {
requires "ExtUtils::MakeMaker" => "0";
requires "perl" => "5.006";
};
on 'configure' => sub {
suggests "JSON::PP" => "2.27300";
};
on 'develop' => sub {
requires "File::Spec" => "0";
requires "IO::Handle" => "0";
requires "IPC::Open3" => "0";
requires "Test::CPAN::Changes" => "0.19";
requires "Test::Mojibake" => "0";
requires "Test::More" => "0.96";
requires "Test::Pod" => "1.41";
requires "Test::Portability::Files" => "0";
requires "Test::Version" => "1";
requires "perl" => "5.006";
};
HTTP-Message-6.22/Changes 000644 000765 000024 00000013435 13625016310 016361 0 ustar 00olafalders staff 000000 000000 Revision history for HTTP-Message
6.22 2020-02-24 18:58:07Z
- Full release. No changes since TRIAL release 6.21
6.21 2020-02-19 14:35:09Z (TRIAL RELEASE)
- Bump Encode to latest version (3.01) (GH#129) (Olaf Alders)
- Revert #115 (GH#131) (Olaf Alders)
- Revert (GH#125) "try hard to make a usable file name" (GH#130) (Olaf
Alders)
- Fix JSON request encoding examples in POD (GH#126) (Michael Schout)
6.20 2019-02-05 01:46:39Z (TRIAL RELEASE)
- Fix encoded file names when LC_ALL=C (GH#125) (Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯)
6.19 2019-01-16 15:17:35Z (TRIAL RELEASE)
- Add support for RFC 8187 encoded filenames (GH#115) (Zaki Mughal)
- Fix memoized _uri_canonical #121 (GH#123) (Dorian Taylor)
- Don't overwrite $@ in decodable (gh #80) (GH#118) (mschae94)
- Add support for RFC 8187 encoded filenames (GH#115) (Zaki Mughal)
6.18 2018-06-05 16:29:15Z
- Revert status_message to original code (GH#111) (Theo van Hoesel)
6.17 2018-06-05 01:55:34Z
- Documented status code 451 in the list of constants (GH #104) (Robert Rothenberg)
- Status code 451 is cachable by default, as per RFC 7725 (GH #104) (Robert Rothenberg)
- Add default status_message for unknown status codes (GH#105) (Robert Rothenberg)
- Corrections to the documentation (GH#102) (Jonas B. Nielsen)
6.16 2018-03-28 14:09:17Z
- Update status codes to official IANA list (GH#100) (Theo van Hoesel)
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.
- PUT and PATCH docs updated (GH #84) (saturdaywalkers)
- Trim trailing \r from status line so message() doesn't return it (GH #87) (Felipe Gasper)
- Bring test coverage of HTTP::Config to 100% (GH #85) (Pete Houston)
- Add 103 Early Hints to HTTP::Status (GH #94) (Tatsuhiko Miyagawa)
6.13 2017-06-20 01:07:03Z
- Non-TRIAL release of changes found in 6.12
6.12 2017-06-15 18:03:50Z (TRIAL RELEASE)
- If an object is passed to HTTP::Request, it must provide a canonical()
method (Olaf Alders)
- Make sure status messages don't die by checking the status exists before
checking the value range (Kent Fredric, GH #39)
- Add a .mailmap file to clean up the contributors list
- Avoid inconsistent setting of content to undef (Jerome Eteve)
- Simplify the way some methods are created (Tom Hukins)
- Remove some indirect object notation (Chase Whitener)
- Fix example in Pod (Tobias Leich)
- Add support for HTTP PATCH method (Mickey Nasriachi)
6.11 2015-09-09
- fix an undefined value warning in HTTP::Headers::as_string
6.10 2015-07-19
- fix uses of qr/.../m in tests that do not work in 5.8.x
6.09 2015-07-19
- converted all uses of Test.pm to Test::More
- fix uninitialized warning in HTTP::Config (RT#105929)
6.08 2015-07-10
- Resolve new uninitialized warning from
HTTP::Request::Common::request_type_with_data (RT#105787)
6.07 2015-07-09
- Allow subclasses to override the class of parts - it used to be hardcoded
to HTTP::Message. (Gisle Aas, RT#79239)
- Added support for is_client_error, is_server_error to HTTP::Response
(Karen Etheridge)
- Added flatten interface to HTTP::Headers (Tokuhiro Matsuno, GH#5)
- Allow PUT to pass content data via hashrefs just like with POST (Michael
Schilli, GH#9)
- Fix for "Content-Encoding: none" header (Gisle Aas, RT#94882)
- Add support for HTTP status 308, defined in RFC 7238 (Olivier Mengué,
RT#104102)
- drop the use of "use vars" (Karen Etheridge)
6.06 2012-10-21
- More forgiving test on croak message [RT#80302] (Gisle Aas)
- Added test for multipart parsing (Gisle Aas)
- Multipart end boundary doesn't need match a complete line [RT#79239]
(Mark Overmeer)
6.05 2012-10-20
- Updated ignores (Gisle Aas)
- No need to prevent visiting field values starting with '_' (Gisle Aas)
- Report the correct croak caller for delegated methods (Gisle Aas)
- Disallow empty field names or field names containing ':' (Gisle Aas)
- Make the extra std_case entries local to each header (Gisle Aas)
6.04 2012-09-30
- Updated repository URL (Gisle Aas)
- Avoid undef warning for empty content (Gisle Aas)
- Teach $m->content_charset about JSON (Gisle Aas)
- Use the canonical charset name for UTF-16LE (and frieds) (Gisle Aas)
- Add option to override the "(no content)" marker of $m->dump (Gisle Aas)
- Use IO::HTML for encoding sniffing (Christopher J. Madsen)
- mime_name was introduced in Encode 2.21 (Christopher J. Madsen)
- Remove an unneeded "require" (Tom Hukins)
- Spelling fixes. (Ville Skyttä)
- Sanitized PERL_HTTP_URI_CLASS environment variable. (chromatic)
- Add test from RT#77466 (Martin H. Sluka)
- Fix doc grammo [RT#75831] (Father Chrysostomos)
6.03 2012-02-16
- Support 'bzip2' as alternative to Content-Encoding: x-bzip2. Some
servers seem to return it.
- Make newlines in forms be "\r\n" terminated.
- Added some more status codes.
- Restore perl-5.8.1 compatibility.
6.02 2011-03-20
- Declare dependency on Bunzip2 v2.021 [RT#66593]
6.01 2011-03-07
- Avoid loading XML::Simple to avoid test failures.
- Eliminate the HTML::Entities dependency.
6.00 2011-02-27
- Initial release of HTTP-Message as a separate distribution. There are no
code changes besides incrementing the version number since
libwww-perl-5.837.
- The HTTP::Message module with friends used to be bundled with the
libwww-perl distribution.
HTTP-Message-6.22/INSTALL 000644 000765 000024 00000004332 13625016310 016113 0 ustar 00olafalders staff 000000 000000 This is the Perl distribution HTTP-Message.
Installing HTTP-Message is straightforward.
## Installation with cpanm
If you have cpanm, you only need one line:
% cpanm HTTP::Message
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.
See the local::lib documentation (https://metacpan.org/pod/local::lib) for
details on enabling it in your environment.
## Installing with the CPAN shell
Alternatively, if your CPAN shell is set up, you should just be able to do:
% cpan HTTP::Message
## Manual installation
As a last resort, you can manually install it. Download the tarball, untar it,
install configure prerequisites (see below), then build it:
% perl Makefile.PL
% make && make test
Then install it:
% make install
On Windows platforms, you should use `dmake` or `nmake`, instead of `make`.
If your perl is system-managed, you can create a local::lib in your home
directory to install modules to. For details, see the local::lib documentation:
https://metacpan.org/pod/local::lib
The prerequisites of this distribution will also have to be installed manually. The
prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated
by running the manual build process described above.
## Configure Prerequisites
This distribution requires other modules to be installed before this
distribution's installer can be run. They can be found under the
"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
HTTP-Message documentation is available as POD.
You can run `perldoc` from a shell to read the documentation:
% perldoc HTTP::Message
For more information on installing Perl modules via CPAN, please see:
https://www.cpan.org/modules/INSTALL.html
HTTP-Message-6.22/MANIFEST 000644 000765 000024 00000001654 13625016310 016217 0 ustar 00olafalders staff 000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012.
CONTRIBUTING.md
CONTRIBUTORS
Changes
INSTALL
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README.md
cpanfile
dist.ini
lib/HTTP/Config.pm
lib/HTTP/Headers.pm
lib/HTTP/Headers/Auth.pm
lib/HTTP/Headers/ETag.pm
lib/HTTP/Headers/Util.pm
lib/HTTP/Message.pm
lib/HTTP/Request.pm
lib/HTTP/Request/Common.pm
lib/HTTP/Response.pm
lib/HTTP/Status.pm
perlcriticrc
perltidyrc
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/common-req.t
t/headers-auth.t
t/headers-etag.t
t/headers-util.t
t/headers.t
t/http-config.t
t/message-charset.t
t/message-decode-xml.t
t/message-old.t
t/message-parts.t
t/message.t
t/request.t
t/request_type_with_data.t
t/response.t
t/status-old.t
t/status.t
tidyall.ini
xt/author/00-compile.t
xt/author/mojibake.t
xt/author/pod-syntax.t
xt/author/portability.t
xt/author/test-version.t
xt/release/changes_has_content.t
xt/release/cpan-changes.t
HTTP-Message-6.22/LICENSE 000644 000765 000024 00000043663 13625016310 016101 0 ustar 00olafalders staff 000000 000000 This software is copyright (c) 1994-2017 by Gisle Aas.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 1994-2017 by Gisle Aas.
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!
--- The Artistic License 1.0 ---
This software is Copyright (c) 1994-2017 by Gisle Aas.
This is free software, licensed under:
The Artistic License 1.0
The Artistic License
Preamble
The intent of this document is to state the conditions under which a Package
may be copied, such that the Copyright Holder maintains some semblance of
artistic control over the development of the package, while giving the users of
the package the right to use and distribute the Package in a more-or-less
customary fashion, plus the right to make reasonable modifications.
Definitions:
- "Package" refers to the collection of files distributed by the Copyright
Holder, and derivatives of that collection of files created through
textual modification.
- "Standard Version" refers to such a Package if it has not been modified,
or has been modified in accordance with the wishes of the Copyright
Holder.
- "Copyright Holder" is whoever is named in the copyright or copyrights for
the package.
- "You" is you, if you're thinking about copying or distributing this Package.
- "Reasonable copying fee" is whatever you can justify on the basis of media
cost, duplication charges, time of people involved, and so on. (You will
not be required to justify it to the Copyright Holder, but only to the
computing community at large as a market that must bear the fee.)
- "Freely Available" means that no fee is charged for the item itself, though
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or an
equivalent medium, or placing the modifications on a major archive site
such as ftp.uu.net, or by allowing the Copyright Holder to include your
modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict with
standard executables, which must also be provided, and provide a separate
manual page for each non-standard executable that clearly documents how it
differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where to
get the Standard Version.
b) accompany the distribution with the machine-readable source of the Package
with your modifications.
c) accompany any non-standard executables with their corresponding Standard
Version executables, giving the non-standard executables non-standard
names, and clearly documenting the differences in manual pages (or
equivalent), together with instructions on where to get the Standard
Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this Package. You
may not charge a fee for this Package itself. However, you may distribute this
Package in aggregate with other (possibly commercial) programs as part of a
larger (possibly commercial) software distribution provided that you do not
advertise this Package as a product of your own.
6. The scripts and library files supplied as input to or produced as output
from the programs of this Package do not automatically fall under the copyright
of this Package, but belong to whomever generated them, and may be sold
commercially, and may be aggregated with this Package.
7. C or perl subroutines supplied by you and linked into this Package shall not
be considered part of this Package.
8. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
HTTP-Message-6.22/t/ 000755 000765 000024 00000000000 13625016310 015323 5 ustar 00olafalders staff 000000 000000 HTTP-Message-6.22/xt/ 000755 000765 000024 00000000000 13625016310 015513 5 ustar 00olafalders staff 000000 000000 HTTP-Message-6.22/META.yml 000644 000765 000024 00000047200 13625016310 016334 0 ustar 00olafalders staff 000000 000000 ---
abstract: 'HTTP style message (base class)'
author:
- 'Gisle Aas '
build_requires:
ExtUtils::MakeMaker: '0'
File::Spec: '0'
PerlIO::encoding: '0'
Test::More: '0.88'
Time::Local: '0'
Try::Tiny: '0'
perl: '5.008001'
configure_requires:
ExtUtils::MakeMaker: '0'
perl: '5.006'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: HTTP-Message
no_index:
directory:
- examples
- t
- xt
requires:
Carp: '0'
Compress::Raw::Zlib: '0'
Encode: '3.01'
Encode::Locale: '1'
Exporter: '5.57'
HTTP::Date: '6'
IO::Compress::Bzip2: '2.021'
IO::Compress::Deflate: '0'
IO::Compress::Gzip: '0'
IO::HTML: '0'
IO::Uncompress::Bunzip2: '2.021'
IO::Uncompress::Gunzip: '0'
IO::Uncompress::Inflate: '0'
IO::Uncompress::RawInflate: '0'
LWP::MediaTypes: '6'
MIME::Base64: '2.1'
MIME::QuotedPrint: '0'
Storable: '0'
URI: '1.10'
base: '0'
perl: '5.008001'
strict: '0'
warnings: '0'
resources:
IRC: irc://irc.perl.org/#lwp
MailingList: mailto:libwww@perl.org
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.22'
x_Dist_Zilla:
perl:
version: '5.030000'
plugins:
-
class: Dist::Zilla::Plugin::MetaResources
name: MetaResources
version: '6.012'
-
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
phase: runtime
type: requires
name: Prereqs
version: '6.012'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 0
check_all_prereqs: 0
modules:
- Dist::Zilla::PluginBundle::Author::OALDERS
phase: build
run_under_travis: 0
skip: []
name: '@Author::OALDERS/stale modules, build'
version: '0.055'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 1
check_all_prereqs: 1
modules: []
phase: release
run_under_travis: 0
skip: []
name: '@Author::OALDERS/stale modules, release'
version: '0.055'
-
class: Dist::Zilla::Plugin::OALDERS::TidyAll
name: '@Author::OALDERS/OALDERS::TidyAll'
version: '0.000026'
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: '@Author::OALDERS/AutoPrereqs'
version: '6.012'
-
class: Dist::Zilla::Plugin::CheckChangesHasContent
name: '@Author::OALDERS/CheckChangesHasContent'
version: '0.011'
-
class: Dist::Zilla::Plugin::MakeMaker
config:
Dist::Zilla::Role::TestRunner:
default_jobs: 1
name: '@Author::OALDERS/MakeMaker'
version: '6.012'
-
class: Dist::Zilla::Plugin::CPANFile
name: '@Author::OALDERS/CPANFile'
version: '6.012'
-
class: Dist::Zilla::Plugin::ContributorsFile
name: '@Author::OALDERS/ContributorsFile'
version: 0.3.0
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@Author::OALDERS/MetaJSON'
version: '6.012'
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@Author::OALDERS/MetaYAML'
version: '6.012'
-
class: Dist::Zilla::Plugin::Manifest
name: '@Author::OALDERS/Manifest'
version: '6.012'
-
class: Dist::Zilla::Plugin::MetaNoIndex
name: '@Author::OALDERS/MetaNoIndex'
version: '6.012'
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@Author::OALDERS/MetaConfig'
version: '6.012'
-
class: Dist::Zilla::Plugin::MetaResources
name: '@Author::OALDERS/MetaResources'
version: '6.012'
-
class: Dist::Zilla::Plugin::License
name: '@Author::OALDERS/License'
version: '6.012'
-
class: Dist::Zilla::Plugin::InstallGuide
config:
Dist::Zilla::Role::ModuleMetadata:
Module::Metadata: '1.000037'
version: '0.006'
name: '@Author::OALDERS/InstallGuide'
version: '1.200013'
-
class: Dist::Zilla::Plugin::ExecDir
name: '@Author::OALDERS/ExecDir'
version: '6.012'
-
class: Dist::Zilla::Plugin::MojibakeTests
name: '@Author::OALDERS/MojibakeTests'
version: '0.8'
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@Author::OALDERS/PodSyntaxTests'
version: '6.012'
-
class: Dist::Zilla::Plugin::Test::CPAN::Changes
config:
Dist::Zilla::Plugin::Test::CPAN::Changes:
changelog: Changes
name: '@Author::OALDERS/Test::CPAN::Changes'
version: '0.012'
-
class: Dist::Zilla::Plugin::Test::Portability
config:
Dist::Zilla::Plugin::Test::Portability:
options: ''
name: '@Author::OALDERS/Test::Portability'
version: '2.001000'
-
class: Dist::Zilla::Plugin::TestRelease
name: '@Author::OALDERS/TestRelease'
version: '6.012'
-
class: Dist::Zilla::Plugin::Test::ReportPrereqs
name: '@Author::OALDERS/Test::ReportPrereqs'
version: '0.027'
-
class: Dist::Zilla::Plugin::Test::Version
name: '@Author::OALDERS/Test::Version'
version: '1.09'
-
class: Dist::Zilla::Plugin::RunExtraTests
config:
Dist::Zilla::Role::TestRunner:
default_jobs: 1
name: '@Author::OALDERS/RunExtraTests'
version: '0.029'
-
class: Dist::Zilla::Plugin::MinimumPerl
name: '@Author::OALDERS/MinimumPerl'
version: '1.006'
-
class: Dist::Zilla::Plugin::PodWeaver
config:
Dist::Zilla::Plugin::PodWeaver:
finder:
- ':InstallModules'
- ':ExecFiles'
plugins:
-
class: Pod::Weaver::Plugin::EnsurePod5
name: '@CorePrep/EnsurePod5'
version: '4.015'
-
class: Pod::Weaver::Plugin::H1Nester
name: '@CorePrep/H1Nester'
version: '4.015'
-
class: Pod::Weaver::Plugin::SingleEncoding
name: '@Default/SingleEncoding'
version: '4.015'
-
class: Pod::Weaver::Section::Name
name: '@Default/Name'
version: '4.015'
-
class: Pod::Weaver::Section::Version
name: '@Default/Version'
version: '4.015'
-
class: Pod::Weaver::Section::Region
name: '@Default/prelude'
version: '4.015'
-
class: Pod::Weaver::Section::Generic
name: SYNOPSIS
version: '4.015'
-
class: Pod::Weaver::Section::Generic
name: DESCRIPTION
version: '4.015'
-
class: Pod::Weaver::Section::Generic
name: OVERVIEW
version: '4.015'
-
class: Pod::Weaver::Section::Collect
name: ATTRIBUTES
version: '4.015'
-
class: Pod::Weaver::Section::Collect
name: METHODS
version: '4.015'
-
class: Pod::Weaver::Section::Collect
name: FUNCTIONS
version: '4.015'
-
class: Pod::Weaver::Section::Leftovers
name: '@Default/Leftovers'
version: '4.015'
-
class: Pod::Weaver::Section::Region
name: '@Default/postlude'
version: '4.015'
-
class: Pod::Weaver::Section::Authors
name: '@Default/Authors'
version: '4.015'
-
class: Pod::Weaver::Section::Legal
name: '@Default/Legal'
version: '4.015'
name: '@Author::OALDERS/PodWeaver'
version: '4.008'
-
class: Dist::Zilla::Plugin::PruneCruft
name: '@Author::OALDERS/PruneCruft'
version: '6.012'
-
class: Dist::Zilla::Plugin::CopyFilesFromBuild
name: '@Author::OALDERS/CopyFilesFromBuild'
version: '0.170880'
-
class: Dist::Zilla::Plugin::GithubMeta
name: '@Author::OALDERS/GithubMeta'
version: '0.58'
-
class: Dist::Zilla::Plugin::Git::GatherDir
config:
Dist::Zilla::Plugin::GatherDir:
exclude_filename:
- Install
- LICENSE
- META.json
- Makefile.PL
- README.md
- cpanfile
exclude_match: []
follow_symlinks: 0
include_dotfiles: 0
prefix: ''
prune_directory: []
root: .
Dist::Zilla::Plugin::Git::GatherDir:
include_untracked: 0
name: '@Author::OALDERS/Git::GatherDir'
version: '2.046'
-
class: Dist::Zilla::Plugin::CopyFilesFromRelease
config:
Dist::Zilla::Plugin::CopyFilesFromRelease:
filename:
- Install
match: []
name: '@Author::OALDERS/CopyFilesFromRelease'
version: '0.006'
-
class: Dist::Zilla::Plugin::Git::Check
config:
Dist::Zilla::Plugin::Git::Check:
untracked_files: die
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- Changes
- Install
- LICENSE
- META.json
- Makefile.PL
- README.md
- cpanfile
- dist.ini
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: 2.25.0
repo_root: .
name: '@Author::OALDERS/Git::Check'
version: '2.046'
-
class: Dist::Zilla::Plugin::Git::Contributors
config:
Dist::Zilla::Plugin::Git::Contributors:
git_version: 2.25.0
include_authors: 0
include_releaser: 1
order_by: name
paths: []
name: '@Author::OALDERS/Git::Contributors'
version: '0.035'
-
class: Dist::Zilla::Plugin::ReadmeAnyFromPod
config:
Dist::Zilla::Role::FileWatcher:
version: '0.006'
name: '@Author::OALDERS/ReadmeMdInBuild'
version: '0.163250'
-
class: Dist::Zilla::Plugin::StaticInstall
config:
Dist::Zilla::Plugin::StaticInstall:
dry_run: 1
mode: auto
name: '@Author::OALDERS/StaticInstall'
version: '0.012'
-
class: Dist::Zilla::Plugin::ShareDir
name: '@Author::OALDERS/ShareDir'
version: '6.012'
-
class: Dist::Zilla::Plugin::TravisCI::StatusBadge
name: '@Author::OALDERS/TravisCI::StatusBadge'
version: '0.007'
-
class: Dist::Zilla::Plugin::CheckIssues
name: '@Author::OALDERS/CheckIssues'
version: '0.011'
-
class: Dist::Zilla::Plugin::ConfirmRelease
name: '@Author::OALDERS/ConfirmRelease'
version: '6.012'
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@Author::OALDERS/UploadToCPAN'
version: '6.012'
-
class: Dist::Zilla::Plugin::RewriteVersion::Transitional
config:
Dist::Zilla::Plugin::RewriteVersion:
add_tarball_name: 0
finders:
- ':ExecFiles'
- ':InstallModules'
global: 0
skip_version_provider: 0
Dist::Zilla::Plugin::RewriteVersion::Transitional: {}
name: '@Author::OALDERS/@Git::VersionManager/RewriteVersion::Transitional'
version: '0.009'
-
class: Dist::Zilla::Plugin::MetaProvides::Update
name: '@Author::OALDERS/@Git::VersionManager/MetaProvides::Update'
version: '0.007'
-
class: Dist::Zilla::Plugin::CopyFilesFromRelease
config:
Dist::Zilla::Plugin::CopyFilesFromRelease:
filename:
- Changes
match: []
name: '@Author::OALDERS/@Git::VersionManager/CopyFilesFromRelease'
version: '0.006'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
Dist::Zilla::Plugin::Git::Commit:
add_files_in: []
commit_msg: v%V%n%n%c
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- Changes
- Install
- LICENSE
- META.json
- Makefile.PL
- README.md
- cpanfile
- dist.ini
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: 2.25.0
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
name: '@Author::OALDERS/@Git::VersionManager/release snapshot'
version: '2.046'
-
class: Dist::Zilla::Plugin::Git::Tag
config:
Dist::Zilla::Plugin::Git::Tag:
branch: ~
changelog: Changes
signed: 0
tag: v6.22
tag_format: v%V
tag_message: v%V
Dist::Zilla::Role::Git::Repo:
git_version: 2.25.0
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
name: '@Author::OALDERS/@Git::VersionManager/Git::Tag'
version: '2.046'
-
class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional
config:
Dist::Zilla::Plugin::BumpVersionAfterRelease:
finders:
- ':ExecFiles'
- ':InstallModules'
global: 0
munge_makefile_pl: 1
Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {}
name: '@Author::OALDERS/@Git::VersionManager/BumpVersionAfterRelease::Transitional'
version: '0.009'
-
class: Dist::Zilla::Plugin::NextRelease
name: '@Author::OALDERS/@Git::VersionManager/NextRelease'
version: '6.012'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
Dist::Zilla::Plugin::Git::Commit:
add_files_in: []
commit_msg: 'increment $VERSION after %v release'
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- Build.PL
- Changes
- Makefile.PL
allow_dirty_match:
- (?^:^lib/.*\.pm$)
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: 2.25.0
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
name: '@Author::OALDERS/@Git::VersionManager/post-release commit'
version: '2.046'
-
class: Dist::Zilla::Plugin::Git::Push
config:
Dist::Zilla::Plugin::Git::Push:
push_to:
- origin
remotes_must_exist: 1
Dist::Zilla::Role::Git::Repo:
git_version: 2.25.0
repo_root: .
name: '@Author::OALDERS/Git::Push'
version: '2.046'
-
class: Dist::Zilla::Plugin::Test::Compile
config:
Dist::Zilla::Plugin::Test::Compile:
bail_out_on_fail: '1'
fail_on_warning: author
fake_home: 0
filename: xt/author/00-compile.t
module_finder:
- ':InstallModules'
needs_display: 0
phase: develop
script_finder:
- ':PerlExecFiles'
skips: []
switch: []
name: Test::Compile
version: '2.058'
-
class: Dist::Zilla::Plugin::Test::ChangesHasContent
name: Test::ChangesHasContent
version: '0.011'
-
class: Dist::Zilla::Plugin::Substitute
name: Substitute
version: '0.006'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExtraTestFiles'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':PerlExecFiles'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':AllFiles'
version: '6.012'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':NoFiles'
version: '6.012'
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: '0'
version: '6.012'
x_contributors:
- 'Adam Kennedy '
- 'Adam Sjogren '
- 'Alexey Tourbin '
- 'Alex Kapranoff '
- 'amire80 '
- 'Andreas J. Koenig '
- 'Bill Mann '
- 'Brendan Byrd '
- 'Bron Gondwana '
- 'Chase Whitener '
- 'Christopher J. Madsen '
- 'chromatic '
- 'Daniel Hedlund '
- 'David E. Wheeler '
- 'DAVIDRW '
- 'David Steinbrunner '
- 'Dorian Taylor '
- 'Father Chrysostomos '
- 'Felipe Gasper '
- 'FWILES '
- 'Gavin Peters '
- 'Gisle Aas '
- 'Graeme Thompson '
- 'Graham Knop '
- 'Hans-H. Froehlich '
- 'Ian Kilgore '
- 'Jacob J '
- 'Jakub Wilk '
- 'jefflee '
- 'Jerome Eteve '
- 'john9art '
- 'jonasbn '
- 'Karen Etheridge '
- 'Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 '
- 'Mark Overmeer '
- 'Mark Stosberg '
- 'Martin H. Sluka '
- 'Matthew Chae '
- 'Michael Schout '
- 'Mickey Nasriachi '
- 'Mike Schilli '
- 'murphy '
- 'Olaf Alders '
- 'Olivier Mengué '
- 'Ondrej Hanak '
- 'openstrike '
- 'Peter Rabbitson '
- 'phrstbrn '
- 'Robert Rothenberg '
- 'Robert Rothenberg '
- 'Robert Stone '
- 'Rolf Grossmann '
- 'ruff '
- 'sasao '
- 'Saturday Walkers Club '
- 'Sean M. Burke '
- 'Slaven Rezic '
- 'Spiros Denaxas '
- 'Steve Hay '
- 'Tatsuhiko Miyagawa '
- 'Tatsuhiko Miyagawa '
- 'Theo van Hoesel '
- 'Tigran '
- 'Tobias Leich '
- 'Todd Lipcon '
- 'tokuhirom '
- 'Tom Hukins '
- 'Tony Finch '
- 'Toru Yamaguchi '
- 'uid39246 '
- 'Ville Skyttä '
- 'Yuri Karaban '
- 'Zakariyya Mughal '
- 'Zefram '
x_generated_by_perl: v5.30.0
x_serialization_backend: 'YAML::Tiny version 1.73'
HTTP-Message-6.22/CONTRIBUTORS 000644 000765 000024 00000003236 13625016310 016744 0 ustar 00olafalders staff 000000 000000
# HTTP-MESSAGE CONTRIBUTORS #
This is the (likely incomplete) list of people who have helped
make this distribution what it is, either via code contributions,
patches, bug reports, help with troubleshooting, etc. A huge
'thank you' to all of them.
* Adam Kennedy
* Adam Sjogren
* Alexey Tourbin
* Alex Kapranoff
* amire80
* Andreas J. Koenig
* Bill Mann
* Brendan Byrd
* Bron Gondwana
* Chase Whitener
* Christopher J. Madsen
* chromatic
* Daniel Hedlund
* David E. Wheeler
* DAVIDRW
* David Steinbrunner
* Dorian Taylor
* Father Chrysostomos
* Felipe Gasper
* FWILES
* Gavin Peters
* Gisle Aas
* Graeme Thompson
* Graham Knop
* Hans-H. Froehlich
* Ian Kilgore
* Jacob J
* Jakub Wilk
* jefflee
* Jerome Eteve
* john9art
* jonasbn
* Karen Etheridge
* Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯
* Mark Overmeer
* Mark Stosberg
* Martin H. Sluka
* Matthew Chae
* Michael Schout
* Mickey Nasriachi
* Mike Schilli
* murphy
* Olaf Alders
* Olivier Mengué
* Ondrej Hanak
* openstrike
* Peter Rabbitson
* phrstbrn
* Robert Rothenberg
* Robert Rothenberg
* Robert Stone
* Rolf Grossmann
* ruff
* sasao
* Saturday Walkers Club
* Sean M. Burke
* Slaven Rezic
* Spiros Denaxas
* Steve Hay
* Tatsuhiko Miyagawa
* Tatsuhiko Miyagawa
* Theo van Hoesel
* Tigran
* Tobias Leich
* Todd Lipcon
* tokuhirom
* Tom Hukins
* Tony Finch
* Toru Yamaguchi
* uid39246
* Ville Skyttä
* Yuri Karaban
* Zakariyya Mughal
* Zefram
HTTP-Message-6.22/META.json 000644 000765 000024 00000072346 13625016310 016515 0 ustar 00olafalders staff 000000 000000 {
"abstract" : "HTTP style message (base class)",
"author" : [
"Gisle Aas "
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "HTTP-Message",
"no_index" : {
"directory" : [
"examples",
"t",
"xt"
]
},
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0",
"perl" : "5.006"
},
"suggests" : {
"JSON::PP" : "2.27300"
}
},
"develop" : {
"requires" : {
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
"Test::CPAN::Changes" : "0.19",
"Test::Mojibake" : "0",
"Test::More" : "0.96",
"Test::Pod" : "1.41",
"Test::Portability::Files" : "0",
"Test::Version" : "1",
"perl" : "5.006"
}
},
"runtime" : {
"requires" : {
"Carp" : "0",
"Compress::Raw::Zlib" : "0",
"Encode" : "3.01",
"Encode::Locale" : "1",
"Exporter" : "5.57",
"HTTP::Date" : "6",
"IO::Compress::Bzip2" : "2.021",
"IO::Compress::Deflate" : "0",
"IO::Compress::Gzip" : "0",
"IO::HTML" : "0",
"IO::Uncompress::Bunzip2" : "2.021",
"IO::Uncompress::Gunzip" : "0",
"IO::Uncompress::Inflate" : "0",
"IO::Uncompress::RawInflate" : "0",
"LWP::MediaTypes" : "6",
"MIME::Base64" : "2.1",
"MIME::QuotedPrint" : "0",
"Storable" : "0",
"URI" : "1.10",
"base" : "0",
"perl" : "5.008001",
"strict" : "0",
"warnings" : "0"
}
},
"test" : {
"recommends" : {
"CPAN::Meta" : "2.120900"
},
"requires" : {
"ExtUtils::MakeMaker" : "0",
"File::Spec" : "0",
"PerlIO::encoding" : "0",
"Test::More" : "0.88",
"Time::Local" : "0",
"Try::Tiny" : "0",
"perl" : "5.008001"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/libwww-perl/HTTP-Message/issues"
},
"homepage" : "https://github.com/libwww-perl/HTTP-Message",
"repository" : {
"type" : "git",
"url" : "https://github.com/libwww-perl/HTTP-Message.git",
"web" : "https://github.com/libwww-perl/HTTP-Message"
},
"x_IRC" : "irc://irc.perl.org/#lwp",
"x_MailingList" : "mailto:libwww@perl.org"
},
"version" : "6.22",
"x_Dist_Zilla" : {
"perl" : {
"version" : "5.030000"
},
"plugins" : [
{
"class" : "Dist::Zilla::Plugin::MetaResources",
"name" : "MetaResources",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
"config" : {
"Dist::Zilla::Plugin::Prereqs" : {
"phase" : "runtime",
"type" : "requires"
}
},
"name" : "Prereqs",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::PromptIfStale",
"config" : {
"Dist::Zilla::Plugin::PromptIfStale" : {
"check_all_plugins" : 0,
"check_all_prereqs" : 0,
"modules" : [
"Dist::Zilla::PluginBundle::Author::OALDERS"
],
"phase" : "build",
"run_under_travis" : 0,
"skip" : []
}
},
"name" : "@Author::OALDERS/stale modules, build",
"version" : "0.055"
},
{
"class" : "Dist::Zilla::Plugin::PromptIfStale",
"config" : {
"Dist::Zilla::Plugin::PromptIfStale" : {
"check_all_plugins" : 1,
"check_all_prereqs" : 1,
"modules" : [],
"phase" : "release",
"run_under_travis" : 0,
"skip" : []
}
},
"name" : "@Author::OALDERS/stale modules, release",
"version" : "0.055"
},
{
"class" : "Dist::Zilla::Plugin::OALDERS::TidyAll",
"name" : "@Author::OALDERS/OALDERS::TidyAll",
"version" : "0.000026"
},
{
"class" : "Dist::Zilla::Plugin::AutoPrereqs",
"name" : "@Author::OALDERS/AutoPrereqs",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::CheckChangesHasContent",
"name" : "@Author::OALDERS/CheckChangesHasContent",
"version" : "0.011"
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 1
}
},
"name" : "@Author::OALDERS/MakeMaker",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::CPANFile",
"name" : "@Author::OALDERS/CPANFile",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::ContributorsFile",
"name" : "@Author::OALDERS/ContributorsFile",
"version" : "0.3.0"
},
{
"class" : "Dist::Zilla::Plugin::MetaJSON",
"name" : "@Author::OALDERS/MetaJSON",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::MetaYAML",
"name" : "@Author::OALDERS/MetaYAML",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::Manifest",
"name" : "@Author::OALDERS/Manifest",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::MetaNoIndex",
"name" : "@Author::OALDERS/MetaNoIndex",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::MetaConfig",
"name" : "@Author::OALDERS/MetaConfig",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::MetaResources",
"name" : "@Author::OALDERS/MetaResources",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::License",
"name" : "@Author::OALDERS/License",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::InstallGuide",
"config" : {
"Dist::Zilla::Role::ModuleMetadata" : {
"Module::Metadata" : "1.000037",
"version" : "0.006"
}
},
"name" : "@Author::OALDERS/InstallGuide",
"version" : "1.200013"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
"name" : "@Author::OALDERS/ExecDir",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::MojibakeTests",
"name" : "@Author::OALDERS/MojibakeTests",
"version" : "0.8"
},
{
"class" : "Dist::Zilla::Plugin::PodSyntaxTests",
"name" : "@Author::OALDERS/PodSyntaxTests",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::Test::CPAN::Changes",
"config" : {
"Dist::Zilla::Plugin::Test::CPAN::Changes" : {
"changelog" : "Changes"
}
},
"name" : "@Author::OALDERS/Test::CPAN::Changes",
"version" : "0.012"
},
{
"class" : "Dist::Zilla::Plugin::Test::Portability",
"config" : {
"Dist::Zilla::Plugin::Test::Portability" : {
"options" : ""
}
},
"name" : "@Author::OALDERS/Test::Portability",
"version" : "2.001000"
},
{
"class" : "Dist::Zilla::Plugin::TestRelease",
"name" : "@Author::OALDERS/TestRelease",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::Test::ReportPrereqs",
"name" : "@Author::OALDERS/Test::ReportPrereqs",
"version" : "0.027"
},
{
"class" : "Dist::Zilla::Plugin::Test::Version",
"name" : "@Author::OALDERS/Test::Version",
"version" : "1.09"
},
{
"class" : "Dist::Zilla::Plugin::RunExtraTests",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 1
}
},
"name" : "@Author::OALDERS/RunExtraTests",
"version" : "0.029"
},
{
"class" : "Dist::Zilla::Plugin::MinimumPerl",
"name" : "@Author::OALDERS/MinimumPerl",
"version" : "1.006"
},
{
"class" : "Dist::Zilla::Plugin::PodWeaver",
"config" : {
"Dist::Zilla::Plugin::PodWeaver" : {
"finder" : [
":InstallModules",
":ExecFiles"
],
"plugins" : [
{
"class" : "Pod::Weaver::Plugin::EnsurePod5",
"name" : "@CorePrep/EnsurePod5",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Plugin::H1Nester",
"name" : "@CorePrep/H1Nester",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Plugin::SingleEncoding",
"name" : "@Default/SingleEncoding",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Name",
"name" : "@Default/Name",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Version",
"name" : "@Default/Version",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "@Default/prelude",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "SYNOPSIS",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "DESCRIPTION",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "OVERVIEW",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "ATTRIBUTES",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "METHODS",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "FUNCTIONS",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Leftovers",
"name" : "@Default/Leftovers",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "@Default/postlude",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Authors",
"name" : "@Default/Authors",
"version" : "4.015"
},
{
"class" : "Pod::Weaver::Section::Legal",
"name" : "@Default/Legal",
"version" : "4.015"
}
]
}
},
"name" : "@Author::OALDERS/PodWeaver",
"version" : "4.008"
},
{
"class" : "Dist::Zilla::Plugin::PruneCruft",
"name" : "@Author::OALDERS/PruneCruft",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::CopyFilesFromBuild",
"name" : "@Author::OALDERS/CopyFilesFromBuild",
"version" : "0.170880"
},
{
"class" : "Dist::Zilla::Plugin::GithubMeta",
"name" : "@Author::OALDERS/GithubMeta",
"version" : "0.58"
},
{
"class" : "Dist::Zilla::Plugin::Git::GatherDir",
"config" : {
"Dist::Zilla::Plugin::GatherDir" : {
"exclude_filename" : [
"Install",
"LICENSE",
"META.json",
"Makefile.PL",
"README.md",
"cpanfile"
],
"exclude_match" : [],
"follow_symlinks" : 0,
"include_dotfiles" : 0,
"prefix" : "",
"prune_directory" : [],
"root" : "."
},
"Dist::Zilla::Plugin::Git::GatherDir" : {
"include_untracked" : 0
}
},
"name" : "@Author::OALDERS/Git::GatherDir",
"version" : "2.046"
},
{
"class" : "Dist::Zilla::Plugin::CopyFilesFromRelease",
"config" : {
"Dist::Zilla::Plugin::CopyFilesFromRelease" : {
"filename" : [
"Install"
],
"match" : []
}
},
"name" : "@Author::OALDERS/CopyFilesFromRelease",
"version" : "0.006"
},
{
"class" : "Dist::Zilla::Plugin::Git::Check",
"config" : {
"Dist::Zilla::Plugin::Git::Check" : {
"untracked_files" : "die"
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
"Changes",
"Install",
"LICENSE",
"META.json",
"Makefile.PL",
"README.md",
"cpanfile",
"dist.ini"
],
"allow_dirty_match" : [],
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.25.0",
"repo_root" : "."
}
},
"name" : "@Author::OALDERS/Git::Check",
"version" : "2.046"
},
{
"class" : "Dist::Zilla::Plugin::Git::Contributors",
"config" : {
"Dist::Zilla::Plugin::Git::Contributors" : {
"git_version" : "2.25.0",
"include_authors" : 0,
"include_releaser" : 1,
"order_by" : "name",
"paths" : []
}
},
"name" : "@Author::OALDERS/Git::Contributors",
"version" : "0.035"
},
{
"class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
"config" : {
"Dist::Zilla::Role::FileWatcher" : {
"version" : "0.006"
}
},
"name" : "@Author::OALDERS/ReadmeMdInBuild",
"version" : "0.163250"
},
{
"class" : "Dist::Zilla::Plugin::StaticInstall",
"config" : {
"Dist::Zilla::Plugin::StaticInstall" : {
"dry_run" : 1,
"mode" : "auto"
}
},
"name" : "@Author::OALDERS/StaticInstall",
"version" : "0.012"
},
{
"class" : "Dist::Zilla::Plugin::ShareDir",
"name" : "@Author::OALDERS/ShareDir",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::TravisCI::StatusBadge",
"name" : "@Author::OALDERS/TravisCI::StatusBadge",
"version" : "0.007"
},
{
"class" : "Dist::Zilla::Plugin::CheckIssues",
"name" : "@Author::OALDERS/CheckIssues",
"version" : "0.011"
},
{
"class" : "Dist::Zilla::Plugin::ConfirmRelease",
"name" : "@Author::OALDERS/ConfirmRelease",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::UploadToCPAN",
"name" : "@Author::OALDERS/UploadToCPAN",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional",
"config" : {
"Dist::Zilla::Plugin::RewriteVersion" : {
"add_tarball_name" : 0,
"finders" : [
":ExecFiles",
":InstallModules"
],
"global" : 0,
"skip_version_provider" : 0
},
"Dist::Zilla::Plugin::RewriteVersion::Transitional" : {}
},
"name" : "@Author::OALDERS/@Git::VersionManager/RewriteVersion::Transitional",
"version" : "0.009"
},
{
"class" : "Dist::Zilla::Plugin::MetaProvides::Update",
"name" : "@Author::OALDERS/@Git::VersionManager/MetaProvides::Update",
"version" : "0.007"
},
{
"class" : "Dist::Zilla::Plugin::CopyFilesFromRelease",
"config" : {
"Dist::Zilla::Plugin::CopyFilesFromRelease" : {
"filename" : [
"Changes"
],
"match" : []
}
},
"name" : "@Author::OALDERS/@Git::VersionManager/CopyFilesFromRelease",
"version" : "0.006"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"config" : {
"Dist::Zilla::Plugin::Git::Commit" : {
"add_files_in" : [],
"commit_msg" : "v%V%n%n%c"
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
"Changes",
"Install",
"LICENSE",
"META.json",
"Makefile.PL",
"README.md",
"cpanfile",
"dist.ini"
],
"allow_dirty_match" : [],
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.25.0",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"time_zone" : "local"
}
},
"name" : "@Author::OALDERS/@Git::VersionManager/release snapshot",
"version" : "2.046"
},
{
"class" : "Dist::Zilla::Plugin::Git::Tag",
"config" : {
"Dist::Zilla::Plugin::Git::Tag" : {
"branch" : null,
"changelog" : "Changes",
"signed" : 0,
"tag" : "v6.22",
"tag_format" : "v%V",
"tag_message" : "v%V"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.25.0",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"time_zone" : "local"
}
},
"name" : "@Author::OALDERS/@Git::VersionManager/Git::Tag",
"version" : "2.046"
},
{
"class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional",
"config" : {
"Dist::Zilla::Plugin::BumpVersionAfterRelease" : {
"finders" : [
":ExecFiles",
":InstallModules"
],
"global" : 0,
"munge_makefile_pl" : 1
},
"Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {}
},
"name" : "@Author::OALDERS/@Git::VersionManager/BumpVersionAfterRelease::Transitional",
"version" : "0.009"
},
{
"class" : "Dist::Zilla::Plugin::NextRelease",
"name" : "@Author::OALDERS/@Git::VersionManager/NextRelease",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"config" : {
"Dist::Zilla::Plugin::Git::Commit" : {
"add_files_in" : [],
"commit_msg" : "increment $VERSION after %v release"
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
"Build.PL",
"Changes",
"Makefile.PL"
],
"allow_dirty_match" : [
"(?^:^lib/.*\\.pm$)"
],
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.25.0",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"time_zone" : "local"
}
},
"name" : "@Author::OALDERS/@Git::VersionManager/post-release commit",
"version" : "2.046"
},
{
"class" : "Dist::Zilla::Plugin::Git::Push",
"config" : {
"Dist::Zilla::Plugin::Git::Push" : {
"push_to" : [
"origin"
],
"remotes_must_exist" : 1
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.25.0",
"repo_root" : "."
}
},
"name" : "@Author::OALDERS/Git::Push",
"version" : "2.046"
},
{
"class" : "Dist::Zilla::Plugin::Test::Compile",
"config" : {
"Dist::Zilla::Plugin::Test::Compile" : {
"bail_out_on_fail" : "1",
"fail_on_warning" : "author",
"fake_home" : 0,
"filename" : "xt/author/00-compile.t",
"module_finder" : [
":InstallModules"
],
"needs_display" : 0,
"phase" : "develop",
"script_finder" : [
":PerlExecFiles"
],
"skips" : [],
"switch" : []
}
},
"name" : "Test::Compile",
"version" : "2.058"
},
{
"class" : "Dist::Zilla::Plugin::Test::ChangesHasContent",
"name" : "Test::ChangesHasContent",
"version" : "0.011"
},
{
"class" : "Dist::Zilla::Plugin::Substitute",
"name" : "Substitute",
"version" : "0.006"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":InstallModules",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":IncModules",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":TestFiles",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExtraTestFiles",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExecFiles",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":PerlExecFiles",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ShareFiles",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":MainModule",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":AllFiles",
"version" : "6.012"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":NoFiles",
"version" : "6.012"
}
],
"zilla" : {
"class" : "Dist::Zilla::Dist::Builder",
"config" : {
"is_trial" : 0
},
"version" : "6.012"
}
},
"x_contributors" : [
"Adam Kennedy ",
"Adam Sjogren ",
"Alexey Tourbin ",
"Alex Kapranoff ",
"amire80 ",
"Andreas J. Koenig ",
"Bill Mann ",
"Brendan Byrd ",
"Bron Gondwana ",
"Chase Whitener ",
"Christopher J. Madsen ",
"chromatic ",
"Daniel Hedlund ",
"David E. Wheeler ",
"DAVIDRW ",
"David Steinbrunner ",
"Dorian Taylor ",
"Father Chrysostomos ",
"Felipe Gasper ",
"FWILES ",
"Gavin Peters ",
"Gisle Aas ",
"Graeme Thompson ",
"Graham Knop ",
"Hans-H. Froehlich ",
"Ian Kilgore ",
"Jacob J ",
"Jakub Wilk ",
"jefflee ",
"Jerome Eteve ",
"john9art ",
"jonasbn ",
"Karen Etheridge ",
"Lars D\u026a\u1d07\u1d04\u1d0b\u1d0f\u1d21 \u8fea\u62c9\u65af ",
"Mark Overmeer ",
"Mark Stosberg ",
"Martin H. Sluka ",
"Matthew Chae ",
"Michael Schout ",
"Mickey Nasriachi ",
"Mike Schilli ",
"murphy ",
"Olaf Alders ",
"Olivier Mengu\u00e9 ",
"Ondrej Hanak ",
"openstrike ",
"Peter Rabbitson ",
"phrstbrn ",
"Robert Rothenberg ",
"Robert Rothenberg ",
"Robert Stone ",
"Rolf Grossmann ",
"ruff ",
"sasao ",
"Saturday Walkers Club ",
"Sean M. Burke ",
"Slaven Rezic ",
"Spiros Denaxas ",
"Steve Hay ",
"Tatsuhiko Miyagawa ",
"Tatsuhiko Miyagawa ",
"Theo van Hoesel ",
"Tigran ",
"Tobias Leich ",
"Todd Lipcon ",
"tokuhirom ",
"Tom Hukins ",
"Tony Finch ",
"Toru Yamaguchi ",
"uid39246 ",
"Ville Skytt\u00e4 ",
"Yuri Karaban ",
"Zakariyya Mughal ",
"Zefram "
],
"x_generated_by_perl" : "v5.30.0",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.14"
}
HTTP-Message-6.22/CONTRIBUTING.md 000644 000765 000024 00000011457 13625016310 017321 0 ustar 00olafalders staff 000000 000000 # HOW TO CONTRIBUTE
Thank you for considering contributing to this distribution. This file
contains instructions that will help you work with the source code.
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
in the repository as a convenience (e.g. Build.PL/Makefile.PL and META.json).
Generally, **you do not need Dist::Zilla to contribute patches**. You may need
Dist::Zilla to create a tarball. See below for guidance.
## Getting dependencies
If you have App::cpanminus 1.6 or later installed, you can use
[cpanm](https://metacpan.org/pod/cpanm) to satisfy dependencies like this:
$ cpanm --installdeps --with-develop .
You can also run this command (or any other cpanm command) without installing
App::cpanminus first, using the fatpacked `cpanm` script via curl or wget:
$ curl -L https://cpanmin.us | perl - --installdeps --with-develop .
$ wget -qO - https://cpanmin.us | perl - --installdeps --with-develop .
Otherwise, look for either a `cpanfile` or `META.json` file for a list of
dependencies to satisfy.
## Running tests
You can run tests directly using the `prove` tool:
$ prove -l
$ prove -lv t/some_test_file.t
## Code style and tidying
This distribution contains a `.perltidyrc` file in the root of the repository.
Please install Perl::Tidy and use `perltidy` before submitting patches. However,
as this is an old distribution and styling has changed somewhat over the years,
please keep your tidying constrained to the portion of code or function in which
you're patching.
$ perltidy -pro=perltidyrc lib/HTTP/Status.pm -o my_tidy_copy.pm
...
$ rm my_tidy_copy.pm
The above command, for example, would provide you with a copy of `Status.pm`
that has been cleaned according to our `.perltidyrc` settings. You'd then look
at the newly created `my_tidy_copy.pm` in the dist root and replace your work
with the cleaned up copy if there are differences.
This may seem like an arbitrary thing, but it is immensely helpful if all code
is written in a singular style. If everything were tidy, it'd look like one
single person wrote the code rather than a mish-mash.
## Installing and using Dist::Zilla
[Dist::Zilla](https://metacpan.org/pod/Dist::Zilla) is a very powerful
authoring tool, optimized for maintaining a large number of distributions with
a high degree of automation, but it has a large dependency chain, a bit of a
learning curve and requires a number of author-specific plugins.
To install it from CPAN, I recommend one of the following approaches for the
quickest installation:
# using CPAN.pm, but bypassing non-functional pod tests
$ cpan TAP::Harness::Restricted
$ PERL_MM_USE_DEFAULT=1 HARNESS_CLASS=TAP::Harness::Restricted cpan Dist::Zilla
# using cpanm, bypassing *all* tests
$ cpanm -n Dist::Zilla
In either case, it's probably going to take about 10 minutes. Go for a walk,
go get a cup of your favorite beverage, take a bathroom break, or whatever.
When you get back, Dist::Zilla should be ready for you.
Then you need to install any plugins specific to this distribution:
$ dzil authordeps --missing | cpanm
You can use Dist::Zilla to install the distribution's dependencies if you
haven't already installed them with cpanm:
$ dzil listdeps --missing --develop | cpanm
Once everything is installed, here are some dzil commands you might try:
$ dzil build
$ dzil test
$ dzil regenerate
You can learn more about Dist::Zilla at http://dzil.org/
## Other notes
This distribution maintains the generated `META.json` and either `Makefile.PL`
or `Build.PL` in the repository. This allows two things:
[Travis CI](https://travis-ci.org/) can build and test the distribution without
requiring Dist::Zilla, and the distribution can be installed directly from
Github or a local git repository using `cpanm` for testing (again, not
requiring Dist::Zilla).
$ cpanm git://github.com/Author/Distribution-Name.git
$ cd Distribution-Name; cpanm .
Contributions are preferred in the form of a Github pull request. See
[Using pull requests](https://help.github.com/articles/using-pull-requests/)
for further information. You can use the Github issue tracker to report issues
without an accompanying patch.
# CREDITS
This file was adapted from an initial `CONTRIBUTING.mkdn` file from David
Golden under the terms of the [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/), with inspiration from the
contributing documents from [Dist::Zilla::Plugin::Author::KENTNL::CONTRIBUTING](https://metacpan.org/pod/Dist::Zilla::Plugin::Author::KENTNL::CONTRIBUTING)
and [Dist::Zilla::PluginBundle::Author::ETHER](https://metacpan.org/pod/Dist::Zilla::PluginBundle::Author::ETHER).
HTTP-Message-6.22/README.md 000644 000765 000024 00000026307 13625016310 016347 0 ustar 00olafalders staff 000000 000000 # NAME
HTTP::Message - HTTP style message (base class)
# VERSION
version 6.22
# SYNOPSIS
use base 'HTTP::Message';
# DESCRIPTION
An `HTTP::Message` object contains some headers and a content body.
The following methods are available:
- $mess = HTTP::Message->new
- $mess = HTTP::Message->new( $headers )
- $mess = HTTP::Message->new( $headers, $content )
This constructs a new message object. Normally you would want
construct `HTTP::Request` or `HTTP::Response` objects instead.
The optional $header argument should be a reference to an
`HTTP::Headers` object or a plain array reference of key/value pairs.
If an `HTTP::Headers` object is provided then a copy of it will be
embedded into the constructed message, i.e. it will not be owned and
can be modified afterwards without affecting the message.
The optional $content argument should be a string of bytes.
- $mess = HTTP::Message->parse( $str )
This constructs a new message object by parsing the given string.
- $mess->headers
Returns the embedded `HTTP::Headers` object.
- $mess->headers\_as\_string
- $mess->headers\_as\_string( $eol )
Call the as\_string() method for the headers in the
message. This will be the same as
$mess->headers->as_string
but it will make your program a whole character shorter :-)
- $mess->content
- $mess->content( $bytes )
The content() method sets the raw content if an argument is given. If no
argument is given the content is not touched. In either case the
original raw content is returned.
If the `undef` argument is given, the content is reset to its default value,
which is an empty string.
Note that the content should be a string of bytes. Strings in perl
can contain characters outside the range of a byte. The `Encode`
module can be used to turn such strings into a string of bytes.
- $mess->add\_content( $bytes )
The add\_content() methods appends more data bytes to the end of the
current content buffer.
- $mess->add\_content\_utf8( $string )
The add\_content\_utf8() method appends the UTF-8 bytes representing the
string to the end of the current content buffer.
- $mess->content\_ref
- $mess->content\_ref( \\$bytes )
The content\_ref() method will return a reference to content buffer string.
It can be more efficient to access the content this way if the content
is huge, and it can even be used for direct manipulation of the content,
for instance:
${$res->content_ref} =~ s/\bfoo\b/bar/g;
This example would modify the content buffer in-place.
If an argument is passed it will setup the content to reference some
external source. The content() and add\_content() methods
will automatically dereference scalar references passed this way. For
other references content() will return the reference itself and
add\_content() will refuse to do anything.
- $mess->content\_charset
This returns the charset used by the content in the message. The
charset is either found as the charset attribute of the
`Content-Type` header or by guessing.
See [http://www.w3.org/TR/REC-html40/charset.html#spec-char-encoding](http://www.w3.org/TR/REC-html40/charset.html#spec-char-encoding)
for details about how charset is determined.
- $mess->decoded\_content( %options )
Returns the content with any `Content-Encoding` undone and for textual content
the raw content encoded to Perl's Unicode strings. If the `Content-Encoding`
or `charset` of the message is unknown this method will fail by returning
`undef`.
The following options can be specified.
- `charset`
This override the charset parameter for text content. The value
`none` can used to suppress decoding of the charset.
- `default_charset`
This override the default charset guessed by content\_charset() or
if that fails "ISO-8859-1".
- `alt_charset`
If decoding fails because the charset specified in the Content-Type header
isn't recognized by Perl's Encode module, then try decoding using this charset
instead of failing. The `alt_charset` might be specified as `none` to simply
return the string without any decoding of charset as alternative.
- `charset_strict`
Abort decoding if malformed characters is found in the content. By
default you get the substitution character ("\\x{FFFD}") in place of
malformed characters.
- `raise_error`
If TRUE then raise an exception if not able to decode content. Reason
might be that the specified `Content-Encoding` or `charset` is not
supported. If this option is FALSE, then decoded\_content() will return
`undef` on errors, but will still set $@.
- `ref`
If TRUE then a reference to decoded content is returned. This might
be more efficient in cases where the decoded content is identical to
the raw content as no data copying is required in this case.
- $mess->decodable
- HTTP::Message::decodable()
This returns the encoding identifiers that decoded\_content() can
process. In scalar context returns a comma separated string of
identifiers.
This value is suitable for initializing the `Accept-Encoding` request
header field.
- $mess->decode
This method tries to replace the content of the message with the
decoded version and removes the `Content-Encoding` header. Returns
TRUE if successful and FALSE if not.
If the message does not have a `Content-Encoding` header this method
does nothing and returns TRUE.
Note that the content of the message is still bytes after this method
has been called and you still need to call decoded\_content() if you
want to process its content as a string.
- $mess->encode( $encoding, ... )
Apply the given encodings to the content of the message. Returns TRUE
if successful. The "identity" (non-)encoding is always supported; other
currently supported encodings, subject to availability of required
additional modules, are "gzip", "deflate", "x-bzip2" and "base64".
A successful call to this function will set the `Content-Encoding`
header.
Note that `multipart/*` or `message/*` messages can't be encoded and
this method will croak if you try.
- $mess->parts
- $mess->parts( @parts )
- $mess->parts( \\@parts )
Messages can be composite, i.e. contain other messages. The composite
messages have a content type of `multipart/*` or `message/*`. This
method give access to the contained messages.
The argumentless form will return a list of `HTTP::Message` objects.
If the content type of $msg is not `multipart/*` or `message/*` then
this will return the empty list. In scalar context only the first
object is returned. The returned message parts should be regarded as
read-only (future versions of this library might make it possible
to modify the parent by modifying the parts).
If the content type of $msg is `message/*` then there will only be
one part returned.
If the content type is `message/http`, then the return value will be
either an `HTTP::Request` or an `HTTP::Response` object.
If a @parts argument is given, then the content of the message will be
modified. The array reference form is provided so that an empty list
can be provided. The @parts array should contain `HTTP::Message`
objects. The @parts objects are owned by $mess after this call and
should not be modified or made part of other messages.
When updating the message with this method and the old content type of
$mess is not `multipart/*` or `message/*`, then the content type is
set to `multipart/mixed` and all other content headers are cleared.
This method will croak if the content type is `message/*` and more
than one part is provided.
- $mess->add\_part( $part )
This will add a part to a message. The $part argument should be
another `HTTP::Message` object. If the previous content type of
$mess is not `multipart/*` then the old content (together with all
content headers) will be made part #1 and the content type made
`multipart/mixed` before the new part is added. The $part object is
owned by $mess after this call and should not be modified or made part
of other messages.
There is no return value.
- $mess->clear
Will clear the headers and set the content to the empty string. There
is no return value
- $mess->protocol
- $mess->protocol( $proto )
Sets the HTTP protocol used for the message. The protocol() is a string
like `HTTP/1.0` or `HTTP/1.1`.
- $mess->clone
Returns a copy of the message object.
- $mess->as\_string
- $mess->as\_string( $eol )
Returns the message formatted as a single string.
The optional $eol parameter specifies the line ending sequence to use.
The default is "\\n". If no $eol is given then as\_string will ensure
that the returned string is newline terminated (even when the message
content is not). No extra newline is appended if an explicit $eol is
passed.
- $mess->dump( %opt )
Returns the message formatted as a string. In void context print the string.
This differs from `$mess->as_string` in that it escapes the bytes
of the content so that it's safe to print them and it limits how much
content to print. The escapes syntax used is the same as for Perl's
double quoted strings. If there is no content the string "(no
content)" is shown in its place.
Options to influence the output can be passed as key/value pairs. The
following options are recognized:
- maxlength => $num
How much of the content to show. The default is 512. Set this to 0
for unlimited.
If the content is longer then the string is chopped at the limit and
the string "...\\n(### more bytes not shown)" appended.
- no\_content => $str
Replaces the "(no content)" marker.
- prefix => $str
A string that will be prefixed to each line of the dump.
All methods unknown to `HTTP::Message` itself are delegated to the
`HTTP::Headers` object that is part of every message. This allows
convenient access to these methods. Refer to [HTTP::Headers](https://metacpan.org/pod/HTTP%3A%3AHeaders) for
details of these methods:
$mess->header( $field => $val )
$mess->push_header( $field => $val )
$mess->init_header( $field => $val )
$mess->remove_header( $field )
$mess->remove_content_headers
$mess->header_field_names
$mess->scan( \&doit )
$mess->date
$mess->expires
$mess->if_modified_since
$mess->if_unmodified_since
$mess->last_modified
$mess->content_type
$mess->content_encoding
$mess->content_length
$mess->content_language
$mess->title
$mess->user_agent
$mess->server
$mess->from
$mess->referer
$mess->www_authenticate
$mess->authorization
$mess->proxy_authorization
$mess->authorization_basic
$mess->proxy_authorization_basic
# AUTHOR
Gisle Aas
# COPYRIGHT AND LICENSE
This software is copyright (c) 1994-2017 by Gisle Aas.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
HTTP-Message-6.22/tidyall.ini 000644 000765 000024 00000000471 13625016310 017225 0 ustar 00olafalders staff 000000 000000 [PerlTidy]
select = **/*.{pl,pm,t,psgi}
ignore = .build/**/*
ignore = HTTP-Message-*/**/*
ignore = blib/**/*
ignore = t/00-*
ignore = t/author-*
ignore = t/release-*
ignore = t/zzz-*
ignore = xt/**/*
argv = --profile=$ROOT/perltidyrc
[SortLines::Naturally]
select = .gitignore
[UniqueLines]
select = .gitignore
HTTP-Message-6.22/lib/ 000755 000765 000024 00000000000 13625016310 015626 5 ustar 00olafalders staff 000000 000000 HTTP-Message-6.22/Makefile.PL 000644 000765 000024 00000004601 13625016310 017033 0 ustar 00olafalders staff 000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012.
use strict;
use warnings;
use 5.008001;
use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "HTTP style message (base class)",
"AUTHOR" => "Gisle Aas ",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "HTTP-Message",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.008001",
"NAME" => "HTTP::Message",
"PREREQ_PM" => {
"Carp" => 0,
"Compress::Raw::Zlib" => 0,
"Encode" => "3.01",
"Encode::Locale" => 1,
"Exporter" => "5.57",
"HTTP::Date" => 6,
"IO::Compress::Bzip2" => "2.021",
"IO::Compress::Deflate" => 0,
"IO::Compress::Gzip" => 0,
"IO::HTML" => 0,
"IO::Uncompress::Bunzip2" => "2.021",
"IO::Uncompress::Gunzip" => 0,
"IO::Uncompress::Inflate" => 0,
"IO::Uncompress::RawInflate" => 0,
"LWP::MediaTypes" => 6,
"MIME::Base64" => "2.1",
"MIME::QuotedPrint" => 0,
"Storable" => 0,
"URI" => "1.10",
"base" => 0,
"strict" => 0,
"warnings" => 0
},
"TEST_REQUIRES" => {
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"PerlIO::encoding" => 0,
"Test::More" => "0.88",
"Time::Local" => 0,
"Try::Tiny" => 0
},
"VERSION" => "6.22",
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"Carp" => 0,
"Compress::Raw::Zlib" => 0,
"Encode" => "3.01",
"Encode::Locale" => 1,
"Exporter" => "5.57",
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"HTTP::Date" => 6,
"IO::Compress::Bzip2" => "2.021",
"IO::Compress::Deflate" => 0,
"IO::Compress::Gzip" => 0,
"IO::HTML" => 0,
"IO::Uncompress::Bunzip2" => "2.021",
"IO::Uncompress::Gunzip" => 0,
"IO::Uncompress::Inflate" => 0,
"IO::Uncompress::RawInflate" => 0,
"LWP::MediaTypes" => 6,
"MIME::Base64" => "2.1",
"MIME::QuotedPrint" => 0,
"PerlIO::encoding" => 0,
"Storable" => 0,
"Test::More" => "0.88",
"Time::Local" => 0,
"Try::Tiny" => 0,
"URI" => "1.10",
"base" => 0,
"strict" => 0,
"warnings" => 0
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
HTTP-Message-6.22/dist.ini 000644 000765 000024 00000002252 13625016310 016525 0 ustar 00olafalders staff 000000 000000 name = HTTP-Message
author = Gisle Aas
license = Perl_5
main_module = lib/HTTP/Message.pm
copyright_holder = Gisle Aas
copyright_year = 1994-2017
[MetaResources]
x_IRC = irc://irc.perl.org/#lwp
x_MailingList = mailto:libwww@perl.org
[Prereqs]
Compress::Raw::Zlib = 0
Encode = 3.01
Encode::Locale = 1
Exporter = 5.57
HTTP::Date = 6
IO::Compress::Bzip2 = 2.021
IO::Uncompress::Bunzip2 = 2.021
LWP::MediaTypes = 6
MIME::Base64 = 2.1
perl = 5.008001
URI = 1.10
[@Author::OALDERS]
; all these tests are TODO
-remove = PodCoverageTests
-remove = Prereqs
-remove = Test::EOL
-remove = Test::Perl::Critic
-remove = Test::PodSpelling
-remove = Test::Synopsis
-remove = Test::TidyAll
[Test::Compile]
bail_out_on_fail = 1
xt_mode = 1
[Test::ChangesHasContent]
[Substitute]
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}
HTTP-Message-6.22/lib/HTTP/ 000755 000765 000024 00000000000 13625016310 016405 5 ustar 00olafalders staff 000000 000000 HTTP-Message-6.22/lib/HTTP/Status.pm 000644 000765 000024 00000030300 13625016310 020222 0 ustar 00olafalders staff 000000 000000 package HTTP::Status;
use strict;
use warnings;
our $VERSION = '6.22';
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 is_cacheable_by_default);
# Note also addition of mnemonics to @EXPORT below
# Unmarked codes are from RFC 7231 (2017-12-20)
# See also:
# https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
my %StatusCode = (
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing', # RFC 2518: WebDAV
103 => 'Early Hints', # RFC 8297: Indicating Hints
# 104 .. 199
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content', # RFC 7233: Range Requests
207 => 'Multi-Status', # RFC 4918: WebDAV
208 => 'Already Reported', # RFC 5842: WebDAV bindings
# 209 .. 225
226 => 'IM used', # RFC 3229: Delta encoding
# 227 .. 299
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified', # RFC 7232: Conditional Request
305 => 'Use Proxy',
307 => 'Temporary Redirect',
308 => 'Permanent Redirect', # RFC 7528: Permanent Redirect
# 309 .. 399
400 => 'Bad Request',
401 => 'Unauthorized', # RFC 7235: Authentication
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required', # RFC 7235: Authentication
408 => 'Request Timeout',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed', # RFC 7232: Conditional Request
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Large',
415 => 'Unsupported Media Type',
416 => 'Request Range Not Satisfiable', # RFC 7233: Range Requests
417 => 'Expectation Failed',
# 418 .. 420
421 => 'Misdirected Request', # RFC 7540: HTTP/2
422 => 'Unprocessable Entity', # RFC 4918: WebDAV
423 => 'Locked', # RFC 4918: WebDAV
424 => 'Failed Dependency', # RFC 4918: WebDAV
# 425
426 => 'Upgrade Required',
# 427
428 => 'Precondition Required', # RFC 6585: Additional Codes
429 => 'Too Many Requests', # RFC 6585: Additional Codes
# 430
431 => 'Request Header Fields Too Large', # RFC 6585: Additional Codes
# 432 .. 450
451 => 'Unavailable For Legal Reasons', # RFC 7724: Legal Obstacles
# 452 .. 499
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported',
506 => 'Variant Also Negotiates', # RFC 2295: Transparant Ngttn
507 => 'Insufficient Storage', # RFC 4918: WebDAV
508 => 'Loop Detected', # RFC 5842: WebDAV bindings
# 509
510 => 'Not Extended', # RFC 2774: Extension Framework
511 => 'Network Authentication Required', # RFC 6585: Additional Codes
);
# keep some unofficial codes that used to be in this distribution
%StatusCode = (
%StatusCode,
418 => 'I\'m a teapot', # RFC 2324: HTCPC/1.0 1-april
425 => 'Unordered Collection', # WebDAV Draft
449 => 'Retry with', # microsoft
509 => 'Bandwidth Limit Exceeded', # Apache / cPanel
);
my $mnemonicCode = '';
my ($code, $message);
while (($code, $message) = each %StatusCode) {
# create mnemonic subroutines
$message =~ s/I'm/I am/;
$message =~ tr/a-z \-/A-Z__/;
$mnemonicCode .= "sub HTTP_$message () { $code }\n";
$mnemonicCode .= "*RC_$message = \\&HTTP_$message;\n"; # legacy
$mnemonicCode .= "push(\@EXPORT_OK, 'HTTP_$message');\n";
$mnemonicCode .= "push(\@EXPORT, 'RC_$message');\n";
}
eval $mnemonicCode; # only one eval for speed
die if $@;
# backwards compatibility
*RC_MOVED_TEMPORARILY = \&RC_FOUND; # 302 was renamed in the standard
push(@EXPORT, "RC_MOVED_TEMPORARILY");
*RC_NO_CODE = \&RC_UNORDERED_COLLECTION;
push(@EXPORT, "RC_NO_CODE");
our %EXPORT_TAGS = (
constants => [grep /^HTTP_/, @EXPORT_OK],
is => [grep /^is_/, @EXPORT, @EXPORT_OK],
);
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_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] == 451 # Unavailable For Legal Reasons
|| $_[0] == 501 # Not Implemented
);
}
1;
=pod
=encoding UTF-8
=head1 NAME
HTTP::Status - HTTP Status code processing
=head1 VERSION
version 6.22
=head1 SYNOPSIS
use HTTP::Status qw(:constants :is status_message);
if ($rc != HTTP_OK) {
print status_message($rc), "\n";
}
if (is_success($rc)) { ... }
if (is_error($rc)) { ... }
if (is_redirect($rc)) { ... }
=head1 DESCRIPTION
I is a library of routines for defining and
classifying HTTP status codes for libwww-perl. Status codes are
used to encode the overall outcome of an HTTP response message. Codes
correspond to those defined in RFC 2616 and RFC 2518.
=head1 CONSTANTS
The following constant functions can be used as mnemonic status code
names. None of these are exported by default. Use the C<:constants>
tag to import them all.
HTTP_CONTINUE (100)
HTTP_SWITCHING_PROTOCOLS (101)
HTTP_PROCESSING (102)
HTTP_EARLY_HINTS (103)
HTTP_OK (200)
HTTP_CREATED (201)
HTTP_ACCEPTED (202)
HTTP_NON_AUTHORITATIVE_INFORMATION (203)
HTTP_NO_CONTENT (204)
HTTP_RESET_CONTENT (205)
HTTP_PARTIAL_CONTENT (206)
HTTP_MULTI_STATUS (207)
HTTP_ALREADY_REPORTED (208)
HTTP_IM_USED (226)
HTTP_MULTIPLE_CHOICES (300)
HTTP_MOVED_PERMANENTLY (301)
HTTP_FOUND (302)
HTTP_SEE_OTHER (303)
HTTP_NOT_MODIFIED (304)
HTTP_USE_PROXY (305)
HTTP_TEMPORARY_REDIRECT (307)
HTTP_PERMANENT_REDIRECT (308)
HTTP_BAD_REQUEST (400)
HTTP_UNAUTHORIZED (401)
HTTP_PAYMENT_REQUIRED (402)
HTTP_FORBIDDEN (403)
HTTP_NOT_FOUND (404)
HTTP_METHOD_NOT_ALLOWED (405)
HTTP_NOT_ACCEPTABLE (406)
HTTP_PROXY_AUTHENTICATION_REQUIRED (407)
HTTP_REQUEST_TIMEOUT (408)
HTTP_CONFLICT (409)
HTTP_GONE (410)
HTTP_LENGTH_REQUIRED (411)
HTTP_PRECONDITION_FAILED (412)
HTTP_REQUEST_ENTITY_TOO_LARGE (413)
HTTP_REQUEST_URI_TOO_LARGE (414)
HTTP_UNSUPPORTED_MEDIA_TYPE (415)
HTTP_REQUEST_RANGE_NOT_SATISFIABLE (416)
HTTP_EXPECTATION_FAILED (417)
HTTP_MISDIRECTED REQUEST (421)
HTTP_UNPROCESSABLE_ENTITY (422)
HTTP_LOCKED (423)
HTTP_FAILED_DEPENDENCY (424)
HTTP_UPGRADE_REQUIRED (426)
HTTP_PRECONDITION_REQUIRED (428)
HTTP_TOO_MANY_REQUESTS (429)
HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE (431)
HTTP_UNAVAILABLE_FOR_LEGAL_REASONS (451)
HTTP_INTERNAL_SERVER_ERROR (500)
HTTP_NOT_IMPLEMENTED (501)
HTTP_BAD_GATEWAY (502)
HTTP_SERVICE_UNAVAILABLE (503)
HTTP_GATEWAY_TIMEOUT (504)
HTTP_HTTP_VERSION_NOT_SUPPORTED (505)
HTTP_VARIANT_ALSO_NEGOTIATES (506)
HTTP_INSUFFICIENT_STORAGE (507)
HTTP_LOOP_DETECTED (508)
HTTP_NOT_EXTENDED (510)
HTTP_NETWORK_AUTHENTICATION_REQUIRED (511)
=head1 FUNCTIONS
The following additional functions are provided. Most of them are
exported by default. The C<:is> import tag can be used to import all
the classification functions.
=over 4
=item status_message( $code )
The status_message() function will translate status codes to human
readable strings. The string is the same as found in the constant
names above. If the $code is not registered in the L
then C is returned.
=item is_info( $code )
Return TRUE if C<$code> is an I status code (1xx). This
class of status code indicates a provisional response which can't have
any content.
=item is_success( $code )
Return TRUE if C<$code> is a I status code (2xx).
=item is_redirect( $code )
Return TRUE if C<$code> is a I status code (3xx). This class of
status code indicates that further action needs to be taken by the
user agent in order to fulfill the request.
=item is_error( $code )
Return TRUE if C<$code> is an I status code (4xx or 5xx). The function
returns TRUE for both client and server error status codes.
=item is_client_error( $code )
Return TRUE if C<$code> is a I status code (4xx). This class
of status code is intended for cases in which the client seems to have
erred.
This function is B exported by default.
=item is_server_error( $code )
Return TRUE if C<$code> is a I status code (5xx). This class
of status codes is intended for cases in which the server is aware
that it has erred or is incapable of performing the request.
This function is B 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.
This function is B exported by default.
=back
=head1 SEE ALSO
L
=head1 BUGS
For legacy reasons all the C constants are exported by default
with the prefix C. It's recommended to use explicit imports and
the C<:constants> tag instead of relying on this.
=head1 AUTHOR
Gisle Aas
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 1994-2017 by Gisle Aas.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__END__
#ABSTRACT: HTTP Status code processing
HTTP-Message-6.22/lib/HTTP/Request.pm 000644 000765 000024 00000021365 13625016310 020402 0 ustar 00olafalders staff 000000 000000 package HTTP::Request;
use strict;
use warnings;
our $VERSION = '6.22';
use base 'HTTP::Message';
sub new
{
my($class, $method, $uri, $header, $content) = @_;
my $self = $class->SUPER::new($header, $content);
$self->method($method);
$self->uri($uri);
$self;
}
sub parse
{
my($class, $str) = @_;
Carp::carp('Undefined argument to parse()') if $^W && ! defined $str;
my $request_line;
if (defined $str && $str =~ s/^(.*)\n//) {
$request_line = $1;
}
else {
$request_line = $str;
$str = "";
}
my $self = $class->SUPER::parse($str);
if (defined $request_line) {
my($method, $uri, $protocol) = split(' ', $request_line);
$self->method($method);
$self->uri($uri) if defined($uri);
$self->protocol($protocol) if $protocol;
}
$self;
}
sub clone
{
my $self = shift;
my $clone = bless $self->SUPER::clone, ref($self);
$clone->method($self->method);
$clone->uri($self->uri);
$clone;
}
sub method
{
shift->_elem('_method', @_);
}
sub uri
{
my $self = shift;
my $old = $self->{'_uri'};
if (@_) {
my $uri = shift;
if (!defined $uri) {
# that's ok
}
elsif (ref $uri) {
Carp::croak("A URI can't be a " . ref($uri) . " reference")
if ref($uri) eq 'HASH' or ref($uri) eq 'ARRAY';
Carp::croak("Can't use a " . ref($uri) . " object as a URI")
unless $uri->can('scheme') && $uri->can('canonical');
$uri = $uri->clone;
unless ($HTTP::URI_CLASS eq "URI") {
# Argh!! Hate this... old LWP legacy!
eval { local $SIG{__DIE__}; $uri = $uri->abs; };
die $@ if $@ && $@ !~ /Missing base argument/;
}
}
else {
$uri = $HTTP::URI_CLASS->new($uri);
}
$self->{'_uri'} = $uri;
delete $self->{'_uri_canonical'};
}
$old;
}
*url = \&uri; # legacy
sub uri_canonical
{
my $self = shift;
my $uri = $self->{_uri};
if (defined (my $canon = $self->{_uri_canonical})) {
# early bailout if these are the exact same string; try to use
# the cheapest comparison method possible
return $canon if $$canon eq $$uri;
}
# otherwise we need to refresh the memoized value
$self->{_uri_canonical} = $uri->canonical;
}
sub accept_decodable
{
my $self = shift;
$self->header("Accept-Encoding", scalar($self->decodable));
}
sub as_string
{
my $self = shift;
my($eol) = @_;
$eol = "\n" unless defined $eol;
my $req_line = $self->method || "-";
my $uri = $self->uri;
$uri = (defined $uri) ? $uri->as_string : "-";
$req_line .= " $uri";
my $proto = $self->protocol;
$req_line .= " $proto" if $proto;
return join($eol, $req_line, $self->SUPER::as_string(@_));
}
sub dump
{
my $self = shift;
my @pre = ($self->method || "-", $self->uri || "-");
if (my $prot = $self->protocol) {
push(@pre, $prot);
}
return $self->SUPER::dump(
preheader => join(" ", @pre),
@_,
);
}
1;
=pod
=encoding UTF-8
=head1 NAME
HTTP::Request - HTTP style request message
=head1 VERSION
version 6.22
=head1 SYNOPSIS
require HTTP::Request;
$request = HTTP::Request->new(GET => 'http://www.example.com/');
and usually used like this:
$ua = LWP::UserAgent->new;
$response = $ua->request($request);
=head1 DESCRIPTION
C is a class encapsulating HTTP style requests,
consisting of a request line, some headers, and a content body. Note
that the LWP library uses HTTP style requests even for non-HTTP
protocols. Instances of this class are usually passed to the
request() method of an C object.
C is a subclass of C and therefore
inherits its methods. The following additional methods are available:
=over 4
=item $r = HTTP::Request->new( $method, $uri )
=item $r = HTTP::Request->new( $method, $uri, $header )
=item $r = HTTP::Request->new( $method, $uri, $header, $content )
Constructs a new C object describing a request on the
object $uri using method $method. The $method argument must be a
string. The $uri argument can be either a string, or a reference to a
C object. The optional $header argument should be a reference to
an C object or a plain array reference of key/value
pairs. The optional $content argument should be a string of bytes.
=item $r = HTTP::Request->parse( $str )
This constructs a new request object by parsing the given string.
=item $r->method
=item $r->method( $val )
This is used to get/set the method attribute. The method should be a
short string like "GET", "HEAD", "PUT", "PATCH" or "POST".
=item $r->uri
=item $r->uri( $val )
This is used to get/set the uri attribute. The $val can be a
reference to a URI object or a plain string. If a string is given,
then it should be parsable as an absolute URI.
=item $r->header( $field )
=item $r->header( $field => $value )
This is used to get/set header values and it is inherited from
C via C. See L for
details and other similar methods that can be used to access the
headers.
=item $r->accept_decodable
This will set the C header to the list of encodings
that decoded_content() can decode.
=item $r->content
=item $r->content( $bytes )
This is used to get/set the content and it is inherited from the
C base class. See L for details and
other methods that can be used to access the content.
Note that the content should be a string of bytes. Strings in perl
can contain characters outside the range of a byte. The C
module can be used to turn such strings into a string of bytes.
=item $r->as_string
=item $r->as_string( $eol )
Method returning a textual representation of the request.
=back
=head1 EXAMPLES
Creating requests to be sent with L or others can be easy. Here
are a few examples.
=head2 Simple POST
Here, we'll create a simple POST request that could be used to send JSON data
to an endpoint.
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Request ();
use JSON::MaybeXS qw(encode_json);
my $url = 'https://www.example.com/api/user/123';
my $header = ['Content-Type' => 'application/json; charset=UTF-8'];
my $data = {foo => 'bar', baz => 'quux'};
my $encoded_data = encode_json($data);
my $r = HTTP::Request->new('POST', $url, $header, $encoded_data);
# at this point, we could send it via LWP::UserAgent
# my $ua = LWP::UserAgent->new();
# my $res = $ua->request($r);
=head2 Batch POST Request
Some services, like Google, allow multiple requests to be sent in one batch.
L for example. Using the
C method from L makes this simple.
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Request ();
use JSON::MaybeXS qw(encode_json);
my $auth_token = 'auth_token';
my $batch_url = 'https://www.googleapis.com/batch';
my $url = 'https://www.googleapis.com/drive/v3/files/fileId/permissions?fields=id';
my $url_no_email = 'https://www.googleapis.com/drive/v3/files/fileId/permissions?fields=id&sendNotificationEmail=false';
# generate a JSON post request for one of the batch entries
my $req1 = build_json_request($url, {
emailAddress => 'example@appsrocks.com',
role => "writer",
type => "user",
});
# generate a JSON post request for one of the batch entries
my $req2 = build_json_request($url_no_email, {
domain => "appsrocks.com",
role => "reader",
type => "domain",
});
# generate a multipart request to send all of the other requests
my $r = HTTP::Request->new('POST', $batch_url, [
'Accept-Encoding' => 'gzip',
# if we don't provide a boundary here, HTTP::Message will generate
# one for us. We could use UUID::uuid() here if we wanted.
'Content-Type' => 'multipart/mixed; boundary=END_OF_PART'
]);
# add the two POST requests to the main request
$r->add_part($req1, $req2);
# at this point, we could send it via LWP::UserAgent
# my $ua = LWP::UserAgent->new();
# my $res = $ua->request($r);
exit();
sub build_json_request {
my ($url, $href) = @_;
my $header = ['Authorization' => "Bearer $auth_token", 'Content-Type' => 'application/json; charset=UTF-8'];
return HTTP::Request->new('POST', $url, $header, encode_json($href));
}
=head1 SEE ALSO
L, L, L,
L
=head1 AUTHOR
Gisle Aas
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 1994-2017 by Gisle Aas.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__END__
#ABSTRACT: HTTP style request message
HTTP-Message-6.22/lib/HTTP/Message.pm 000644 000765 000024 00000074031 13625016310 020334 0 ustar 00olafalders staff 000000 000000 package HTTP::Message;
use strict;
use warnings;
our $VERSION = '6.22';
require HTTP::Headers;
require Carp;
my $CRLF = "\015\012"; # "\r\n" is not portable
unless ($HTTP::URI_CLASS) {
if ($ENV{PERL_HTTP_URI_CLASS}
&& $ENV{PERL_HTTP_URI_CLASS} =~ /^([\w:]+)$/) {
$HTTP::URI_CLASS = $1;
} else {
$HTTP::URI_CLASS = "URI";
}
}
eval "require $HTTP::URI_CLASS"; die $@ if $@;
*_utf8_downgrade = defined(&utf8::downgrade) ?
sub {
utf8::downgrade($_[0], 1) or
Carp::croak("HTTP::Message content must be bytes")
}
:
sub {
};
sub new
{
my($class, $header, $content) = @_;
if (defined $header) {
Carp::croak("Bad header argument") unless ref $header;
if (ref($header) eq "ARRAY") {
$header = HTTP::Headers->new(@$header);
}
else {
$header = $header->clone;
}
}
else {
$header = HTTP::Headers->new;
}
if (defined $content) {
_utf8_downgrade($content);
}
else {
$content = '';
}
bless {
'_headers' => $header,
'_content' => $content,
}, $class;
}
sub parse
{
my($class, $str) = @_;
my @hdr;
while (1) {
if ($str =~ s/^([^\s:]+)[ \t]*: ?(.*)\n?//) {
push(@hdr, $1, $2);
$hdr[-1] =~ s/\r\z//;
}
elsif (@hdr && $str =~ s/^([ \t].*)\n?//) {
$hdr[-1] .= "\n$1";
$hdr[-1] =~ s/\r\z//;
}
else {
$str =~ s/^\r?\n//;
last;
}
}
local $HTTP::Headers::TRANSLATE_UNDERSCORE;
new($class, \@hdr, $str);
}
sub clone
{
my $self = shift;
my $clone = HTTP::Message->new($self->headers,
$self->content);
$clone->protocol($self->protocol);
$clone;
}
sub clear {
my $self = shift;
$self->{_headers}->clear;
$self->content("");
delete $self->{_parts};
return;
}
sub protocol {
shift->_elem('_protocol', @_);
}
sub headers {
my $self = shift;
# recalculation of _content might change headers, so we
# need to force it now
$self->_content unless exists $self->{_content};
$self->{_headers};
}
sub headers_as_string {
shift->headers->as_string(@_);
}
sub content {
my $self = $_[0];
if (defined(wantarray)) {
$self->_content unless exists $self->{_content};
my $old = $self->{_content};
$old = $$old if ref($old) eq "SCALAR";
&_set_content if @_ > 1;
return $old;
}
if (@_ > 1) {
&_set_content;
}
else {
Carp::carp("Useless content call in void context") if $^W;
}
}
sub _set_content {
my $self = $_[0];
_utf8_downgrade($_[1]);
if (!ref($_[1]) && ref($self->{_content}) eq "SCALAR") {
${$self->{_content}} = defined( $_[1] ) ? $_[1] : '';
}
else {
die "Can't set content to be a scalar reference" if ref($_[1]) eq "SCALAR";
$self->{_content} = defined( $_[1] ) ? $_[1] : '';
delete $self->{_content_ref};
}
delete $self->{_parts} unless $_[2];
}
sub add_content
{
my $self = shift;
$self->_content unless exists $self->{_content};
my $chunkref = \$_[0];
$chunkref = $$chunkref if ref($$chunkref); # legacy
_utf8_downgrade($$chunkref);
my $ref = ref($self->{_content});
if (!$ref) {
$self->{_content} .= $$chunkref;
}
elsif ($ref eq "SCALAR") {
${$self->{_content}} .= $$chunkref;
}
else {
Carp::croak("Can't append to $ref content");
}
delete $self->{_parts};
}
sub add_content_utf8 {
my($self, $buf) = @_;
utf8::upgrade($buf);
utf8::encode($buf);
$self->add_content($buf);
}
sub content_ref
{
my $self = shift;
$self->_content unless exists $self->{_content};
delete $self->{_parts};
my $old = \$self->{_content};
my $old_cref = $self->{_content_ref};
if (@_) {
my $new = shift;
Carp::croak("Setting content_ref to a non-ref") unless ref($new);
delete $self->{_content}; # avoid modifying $$old
$self->{_content} = $new;
$self->{_content_ref}++;
}
$old = $$old if $old_cref;
return $old;
}
sub content_charset
{
my $self = shift;
if (my $charset = $self->content_type_charset) {
return $charset;
}
# time to start guessing
my $cref = $self->decoded_content(ref => 1, charset => "none");
# Unicode BOM
for ($$cref) {
return "UTF-8" if /^\xEF\xBB\xBF/;
return "UTF-32LE" if /^\xFF\xFE\x00\x00/;
return "UTF-32BE" if /^\x00\x00\xFE\xFF/;
return "UTF-16LE" if /^\xFF\xFE/;
return "UTF-16BE" if /^\xFE\xFF/;
}
if ($self->content_is_xml) {
# http://www.w3.org/TR/2006/REC-xml-20060816/#sec-guessing
# XML entity not accompanied by external encoding information and not
# in UTF-8 or UTF-16 encoding must begin with an XML encoding declaration,
# in which the first characters must be ')/) {
if ($1 =~ /\sencoding\s*=\s*(["'])(.*?)\1/) {
my $enc = $2;
$enc =~ s/^\s+//; $enc =~ s/\s+\z//;
return $enc if $enc;
}
}
}
return "UTF-8";
}
elsif ($self->content_is_html) {
# look for or
# http://dev.w3.org/html5/spec/Overview.html#determining-the-character-encoding
require IO::HTML;
# Use relaxed search to match previous versions of HTTP::Message:
my $encoding = IO::HTML::find_charset_in($$cref, { encoding => 1,
need_pragma => 0 });
return $encoding->mime_name if $encoding;
}
elsif ($self->content_type eq "application/json") {
for ($$cref) {
# RFC 4627, ch 3
return "UTF-32BE" if /^\x00\x00\x00./s;
return "UTF-32LE" if /^.\x00\x00\x00/s;
return "UTF-16BE" if /^\x00.\x00./s;
return "UTF-16LE" if /^.\x00.\x00/s;
return "UTF-8";
}
}
if ($self->content_type =~ /^text\//) {
for ($$cref) {
if (length) {
return "US-ASCII" unless /[\x80-\xFF]/;
require Encode;
eval {
Encode::decode_utf8($_, Encode::FB_CROAK() | Encode::LEAVE_SRC());
};
return "UTF-8" unless $@;
return "ISO-8859-1";
}
}
}
return undef;
}
sub decoded_content
{
my($self, %opt) = @_;
my $content_ref;
my $content_ref_iscopy;
eval {
$content_ref = $self->content_ref;
die "Can't decode ref content" if ref($content_ref) ne "SCALAR";
if (my $h = $self->header("Content-Encoding")) {
$h =~ s/^\s+//;
$h =~ s/\s+$//;
for my $ce (reverse split(/\s*,\s*/, lc($h))) {
next unless $ce;
next if $ce eq "identity" || $ce eq "none";
if ($ce eq "gzip" || $ce eq "x-gzip") {
require IO::Uncompress::Gunzip;
my $output;
IO::Uncompress::Gunzip::gunzip($content_ref, \$output, Transparent => 0)
or die "Can't gunzip content: $IO::Uncompress::Gunzip::GunzipError";
$content_ref = \$output;
$content_ref_iscopy++;
}
elsif ($ce eq "x-bzip2" or $ce eq "bzip2") {
require IO::Uncompress::Bunzip2;
my $output;
IO::Uncompress::Bunzip2::bunzip2($content_ref, \$output, Transparent => 0)
or die "Can't bunzip content: $IO::Uncompress::Bunzip2::Bunzip2Error";
$content_ref = \$output;
$content_ref_iscopy++;
}
elsif ($ce eq "deflate") {
require IO::Uncompress::Inflate;
my $output;
my $status = IO::Uncompress::Inflate::inflate($content_ref, \$output, Transparent => 0);
my $error = $IO::Uncompress::Inflate::InflateError;
unless ($status) {
# "Content-Encoding: deflate" is supposed to mean the
# "zlib" format of RFC 1950, but Microsoft got that
# wrong, so some servers sends the raw compressed
# "deflate" data. This tries to inflate this format.
$output = undef;
require IO::Uncompress::RawInflate;
unless (IO::Uncompress::RawInflate::rawinflate($content_ref, \$output)) {
$self->push_header("Client-Warning" =>
"Could not raw inflate content: $IO::Uncompress::RawInflate::RawInflateError");
$output = undef;
}
}
die "Can't inflate content: $error" unless defined $output;
$content_ref = \$output;
$content_ref_iscopy++;
}
elsif ($ce eq "compress" || $ce eq "x-compress") {
die "Can't uncompress content";
}
elsif ($ce eq "base64") { # not really C-T-E, but should be harmless
require MIME::Base64;
$content_ref = \MIME::Base64::decode($$content_ref);
$content_ref_iscopy++;
}
elsif ($ce eq "quoted-printable") { # not really C-T-E, but should be harmless
require MIME::QuotedPrint;
$content_ref = \MIME::QuotedPrint::decode($$content_ref);
$content_ref_iscopy++;
}
else {
die "Don't know how to decode Content-Encoding '$ce'";
}
}
}
if ($self->content_is_text || (my $is_xml = $self->content_is_xml)) {
my $charset = lc(
$opt{charset} ||
$self->content_type_charset ||
$opt{default_charset} ||
$self->content_charset ||
"ISO-8859-1"
);
if ($charset eq "none") {
# leave it as is
}
elsif ($charset eq "us-ascii" || $charset eq "iso-8859-1") {
if ($$content_ref =~ /[^\x00-\x7F]/ && defined &utf8::upgrade) {
unless ($content_ref_iscopy) {
my $copy = $$content_ref;
$content_ref = \$copy;
$content_ref_iscopy++;
}
utf8::upgrade($$content_ref);
}
}
else {
require Encode;
eval {
$content_ref = \Encode::decode($charset, $$content_ref,
($opt{charset_strict} ? Encode::FB_CROAK() : 0) | Encode::LEAVE_SRC());
};
if ($@) {
my $retried;
if ($@ =~ /^Unknown encoding/) {
my $alt_charset = lc($opt{alt_charset} || "");
if ($alt_charset && $charset ne $alt_charset) {
# Retry decoding with the alternative charset
$content_ref = \Encode::decode($alt_charset, $$content_ref,
($opt{charset_strict} ? Encode::FB_CROAK() : 0) | Encode::LEAVE_SRC())
unless $alt_charset eq "none";
$retried++;
}
}
die unless $retried;
}
die "Encode::decode() returned undef improperly" unless defined $$content_ref;
if ($is_xml) {
# Get rid of the XML encoding declaration if present
$$content_ref =~ s/^\x{FEFF}//;
if ($$content_ref =~ /^(\s*<\?xml[^\x00]*?\?>)/) {
substr($$content_ref, 0, length($1)) =~ s/\sencoding\s*=\s*(["']).*?\1//;
}
}
}
}
};
if ($@) {
Carp::croak($@) if $opt{raise_error};
return undef;
}
return $opt{ref} ? $content_ref : $$content_ref;
}
sub decodable
{
# should match the Content-Encoding values that decoded_content can deal with
my $self = shift;
my @enc;
local $@;
# XXX preferably we should determine if the modules are available without loading
# them here
eval {
require IO::Uncompress::Gunzip;
push(@enc, "gzip", "x-gzip");
};
eval {
require IO::Uncompress::Inflate;
require IO::Uncompress::RawInflate;
push(@enc, "deflate");
};
eval {
require IO::Uncompress::Bunzip2;
push(@enc, "x-bzip2", "bzip2");
};
# we don't care about announcing the 'identity', 'base64' and
# 'quoted-printable' stuff
return wantarray ? @enc : join(", ", @enc);
}
sub decode
{
my $self = shift;
return 1 unless $self->header("Content-Encoding");
if (defined(my $content = $self->decoded_content(charset => "none"))) {
$self->remove_header("Content-Encoding", "Content-Length", "Content-MD5");
$self->content($content);
return 1;
}
return 0;
}
sub encode
{
my($self, @enc) = @_;
Carp::croak("Can't encode multipart/* messages") if $self->content_type =~ m,^multipart/,;
Carp::croak("Can't encode message/* messages") if $self->content_type =~ m,^message/,;
return 1 unless @enc; # nothing to do
my $content = $self->content;
for my $encoding (@enc) {
if ($encoding eq "identity" || $encoding eq "none") {
# nothing to do
}
elsif ($encoding eq "base64") {
require MIME::Base64;
$content = MIME::Base64::encode($content);
}
elsif ($encoding eq "gzip" || $encoding eq "x-gzip") {
require IO::Compress::Gzip;
my $output;
IO::Compress::Gzip::gzip(\$content, \$output, Minimal => 1)
or die "Can't gzip content: $IO::Compress::Gzip::GzipError";
$content = $output;
}
elsif ($encoding eq "deflate") {
require IO::Compress::Deflate;
my $output;
IO::Compress::Deflate::deflate(\$content, \$output)
or die "Can't deflate content: $IO::Compress::Deflate::DeflateError";
$content = $output;
}
elsif ($encoding eq "x-bzip2" || $encoding eq "bzip2") {
require IO::Compress::Bzip2;
my $output;
IO::Compress::Bzip2::bzip2(\$content, \$output)
or die "Can't bzip2 content: $IO::Compress::Bzip2::Bzip2Error";
$content = $output;
}
elsif ($encoding eq "rot13") { # for the fun of it
$content =~ tr/A-Za-z/N-ZA-Mn-za-m/;
}
else {
return 0;
}
}
my $h = $self->header("Content-Encoding");
unshift(@enc, $h) if $h;
$self->header("Content-Encoding", join(", ", @enc));
$self->remove_header("Content-Length", "Content-MD5");
$self->content($content);
return 1;
}
sub as_string
{
my($self, $eol) = @_;
$eol = "\n" unless defined $eol;
# The calculation of content might update the headers
# so we need to do that first.
my $content = $self->content;
return join("", $self->{'_headers'}->as_string($eol),
$eol,
$content,
(@_ == 1 && length($content) &&
$content !~ /\n\z/) ? "\n" : "",
);
}
sub dump
{
my($self, %opt) = @_;
my $content = $self->content;
my $chopped = 0;
if (!ref($content)) {
my $maxlen = $opt{maxlength};
$maxlen = 512 unless defined($maxlen);
if ($maxlen && length($content) > $maxlen * 1.1 + 3) {
$chopped = length($content) - $maxlen;
$content = substr($content, 0, $maxlen) . "...";
}
$content =~ s/\\/\\\\/g;
$content =~ s/\t/\\t/g;
$content =~ s/\r/\\r/g;
# no need for 3 digits in escape for these
$content =~ s/([\0-\11\13-\037])(?!\d)/sprintf('\\%o',ord($1))/eg;
$content =~ s/([\0-\11\13-\037\177-\377])/sprintf('\\x%02X',ord($1))/eg;
$content =~ s/([^\12\040-\176])/sprintf('\\x{%X}',ord($1))/eg;
# remaining whitespace
$content =~ s/( +)\n/("\\40" x length($1)) . "\n"/eg;
$content =~ s/(\n+)\n/("\\n" x length($1)) . "\n"/eg;
$content =~ s/\n\z/\\n/;
my $no_content = $opt{no_content};
$no_content = "(no content)" unless defined $no_content;
if ($content eq $no_content) {
# escape our $no_content marker
$content =~ s/^(.)/sprintf('\\x%02X',ord($1))/eg;
}
elsif ($content eq "") {
$content = $no_content;
}
}
my @dump;
push(@dump, $opt{preheader}) if $opt{preheader};
push(@dump, $self->{_headers}->as_string, $content);
push(@dump, "(+ $chopped more bytes not shown)") if $chopped;
my $dump = join("\n", @dump, "");
$dump =~ s/^/$opt{prefix}/gm if $opt{prefix};
print $dump unless defined wantarray;
return $dump;
}
# allow subclasses to override what will handle individual parts
sub _part_class {
return __PACKAGE__;
}
sub parts {
my $self = shift;
if (defined(wantarray) && (!exists $self->{_parts} || ref($self->{_content}) eq "SCALAR")) {
$self->_parts;
}
my $old = $self->{_parts};
if (@_) {
my @parts = map { ref($_) eq 'ARRAY' ? @$_ : $_ } @_;
my $ct = $self->content_type || "";
if ($ct =~ m,^message/,) {
Carp::croak("Only one part allowed for $ct content")
if @parts > 1;
}
elsif ($ct !~ m,^multipart/,) {
$self->remove_content_headers;
$self->content_type("multipart/mixed");
}
$self->{_parts} = \@parts;
_stale_content($self);
}
return @$old if wantarray;
return $old->[0];
}
sub add_part {
my $self = shift;
if (($self->content_type || "") !~ m,^multipart/,) {
my $p = $self->_part_class->new(
$self->remove_content_headers,
$self->content(""),
);
$self->content_type("multipart/mixed");
$self->{_parts} = [];
if ($p->headers->header_field_names || $p->content ne "") {
push(@{$self->{_parts}}, $p);
}
}
elsif (!exists $self->{_parts} || ref($self->{_content}) eq "SCALAR") {
$self->_parts;
}
push(@{$self->{_parts}}, @_);
_stale_content($self);
return;
}
sub _stale_content {
my $self = shift;
if (ref($self->{_content}) eq "SCALAR") {
# must recalculate now
$self->_content;
}
else {
# just invalidate cache
delete $self->{_content};
delete $self->{_content_ref};
}
}
# delegate all other method calls to the headers object.
our $AUTOLOAD;
sub AUTOLOAD
{
my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::')+2);
# We create the function here so that it will not need to be
# autoloaded the next time.
no strict 'refs';
*$method = sub { local $Carp::Internal{+__PACKAGE__} = 1; shift->headers->$method(@_) };
goto &$method;
}
sub DESTROY {} # avoid AUTOLOADing it
# Private method to access members in %$self
sub _elem
{
my $self = shift;
my $elem = shift;
my $old = $self->{$elem};
$self->{$elem} = $_[0] if @_;
return $old;
}
# Create private _parts attribute from current _content
sub _parts {
my $self = shift;
my $ct = $self->content_type;
if ($ct =~ m,^multipart/,) {
require HTTP::Headers::Util;
my @h = HTTP::Headers::Util::split_header_words($self->header("Content-Type"));
die "Assert" unless @h;
my %h = @{$h[0]};
if (defined(my $b = $h{boundary})) {
my $str = $self->content;
$str =~ s/\r?\n--\Q$b\E--.*//s;
if ($str =~ s/(^|.*?\r?\n)--\Q$b\E\r?\n//s) {
$self->{_parts} = [map $self->_part_class->parse($_),
split(/\r?\n--\Q$b\E\r?\n/, $str)]
}
}
}
elsif ($ct eq "message/http") {
require HTTP::Request;
require HTTP::Response;
my $content = $self->content;
my $class = ($content =~ m,^(HTTP/.*)\n,) ?
"HTTP::Response" : "HTTP::Request";
$self->{_parts} = [$class->parse($content)];
}
elsif ($ct =~ m,^message/,) {
$self->{_parts} = [ $self->_part_class->parse($self->content) ];
}
$self->{_parts} ||= [];
}
# Create private _content attribute from current _parts
sub _content {
my $self = shift;
my $ct = $self->{_headers}->header("Content-Type") || "multipart/mixed";
if ($ct =~ m,^\s*message/,i) {
_set_content($self, $self->{_parts}[0]->as_string($CRLF), 1);
return;
}
require HTTP::Headers::Util;
my @v = HTTP::Headers::Util::split_header_words($ct);
Carp::carp("Multiple Content-Type headers") if @v > 1;
@v = @{$v[0]};
my $boundary;
my $boundary_index;
for (my @tmp = @v; @tmp;) {
my($k, $v) = splice(@tmp, 0, 2);
if ($k eq "boundary") {
$boundary = $v;
$boundary_index = @v - @tmp - 1;
last;
}
}
my @parts = map $_->as_string($CRLF), @{$self->{_parts}};
my $bno = 0;
$boundary = _boundary() unless defined $boundary;
CHECK_BOUNDARY:
{
for (@parts) {
if (index($_, $boundary) >= 0) {
# must have a better boundary
$boundary = _boundary(++$bno);
redo CHECK_BOUNDARY;
}
}
}
if ($boundary_index) {
$v[$boundary_index] = $boundary;
}
else {
push(@v, boundary => $boundary);
}
$ct = HTTP::Headers::Util::join_header_words(@v);
$self->{_headers}->header("Content-Type", $ct);
_set_content($self, "--$boundary$CRLF" .
join("$CRLF--$boundary$CRLF", @parts) .
"$CRLF--$boundary--$CRLF",
1);
}
sub _boundary
{
my $size = shift || return "xYzZY";
require MIME::Base64;
my $b = MIME::Base64::encode(join("", map chr(rand(256)), 1..$size*3), "");
$b =~ s/[\W]/X/g; # ensure alnum only
$b;
}
1;
=pod
=encoding UTF-8
=head1 NAME
HTTP::Message - HTTP style message (base class)
=head1 VERSION
version 6.22
=head1 SYNOPSIS
use base 'HTTP::Message';
=head1 DESCRIPTION
An C object contains some headers and a content body.
The following methods are available:
=over 4
=item $mess = HTTP::Message->new
=item $mess = HTTP::Message->new( $headers )
=item $mess = HTTP::Message->new( $headers, $content )
This constructs a new message object. Normally you would want
construct C or C objects instead.
The optional $header argument should be a reference to an
C object or a plain array reference of key/value pairs.
If an C object is provided then a copy of it will be
embedded into the constructed message, i.e. it will not be owned and
can be modified afterwards without affecting the message.
The optional $content argument should be a string of bytes.
=item $mess = HTTP::Message->parse( $str )
This constructs a new message object by parsing the given string.
=item $mess->headers
Returns the embedded C object.
=item $mess->headers_as_string
=item $mess->headers_as_string( $eol )
Call the as_string() method for the headers in the
message. This will be the same as
$mess->headers->as_string
but it will make your program a whole character shorter :-)
=item $mess->content
=item $mess->content( $bytes )
The content() method sets the raw content if an argument is given. If no
argument is given the content is not touched. In either case the
original raw content is returned.
If the C argument is given, the content is reset to its default value,
which is an empty string.
Note that the content should be a string of bytes. Strings in perl
can contain characters outside the range of a byte. The C
module can be used to turn such strings into a string of bytes.
=item $mess->add_content( $bytes )
The add_content() methods appends more data bytes to the end of the
current content buffer.
=item $mess->add_content_utf8( $string )
The add_content_utf8() method appends the UTF-8 bytes representing the
string to the end of the current content buffer.
=item $mess->content_ref
=item $mess->content_ref( \$bytes )
The content_ref() method will return a reference to content buffer string.
It can be more efficient to access the content this way if the content
is huge, and it can even be used for direct manipulation of the content,
for instance:
${$res->content_ref} =~ s/\bfoo\b/bar/g;
This example would modify the content buffer in-place.
If an argument is passed it will setup the content to reference some
external source. The content() and add_content() methods
will automatically dereference scalar references passed this way. For
other references content() will return the reference itself and
add_content() will refuse to do anything.
=item $mess->content_charset
This returns the charset used by the content in the message. The
charset is either found as the charset attribute of the
C header or by guessing.
See L
for details about how charset is determined.
=item $mess->decoded_content( %options )
Returns the content with any C undone and for textual content
the raw content encoded to Perl's Unicode strings. If the C
or C of the message is unknown this method will fail by returning
C.
The following options can be specified.
=over
=item C
This override the charset parameter for text content. The value
C can used to suppress decoding of the charset.
=item C
This override the default charset guessed by content_charset() or
if that fails "ISO-8859-1".
=item C
If decoding fails because the charset specified in the Content-Type header
isn't recognized by Perl's Encode module, then try decoding using this charset
instead of failing. The C might be specified as C to simply
return the string without any decoding of charset as alternative.
=item C
Abort decoding if malformed characters is found in the content. By
default you get the substitution character ("\x{FFFD}") in place of
malformed characters.
=item C
If TRUE then raise an exception if not able to decode content. Reason
might be that the specified C or C is not
supported. If this option is FALSE, then decoded_content() will return
C on errors, but will still set $@.
=item C[
If TRUE then a reference to decoded content is returned. This might
be more efficient in cases where the decoded content is identical to
the raw content as no data copying is required in this case.
=back
=item $mess->decodable
=item HTTP::Message::decodable()
This returns the encoding identifiers that decoded_content() can
process. In scalar context returns a comma separated string of
identifiers.
This value is suitable for initializing the C request
header field.
=item $mess->decode
This method tries to replace the content of the message with the
decoded version and removes the C header. Returns
TRUE if successful and FALSE if not.
If the message does not have a C header this method
does nothing and returns TRUE.
Note that the content of the message is still bytes after this method
has been called and you still need to call decoded_content() if you
want to process its content as a string.
=item $mess->encode( $encoding, ... )
Apply the given encodings to the content of the message. Returns TRUE
if successful. The "identity" (non-)encoding is always supported; other
currently supported encodings, subject to availability of required
additional modules, are "gzip", "deflate", "x-bzip2" and "base64".
A successful call to this function will set the C
header.
Note that C or C messages can't be encoded and
this method will croak if you try.
=item $mess->parts
=item $mess->parts( @parts )
=item $mess->parts( \@parts )
Messages can be composite, i.e. contain other messages. The composite
messages have a content type of C or C. This
method give access to the contained messages.
The argumentless form will return a list of C objects.
If the content type of $msg is not C or C then
this will return the empty list. In scalar context only the first
object is returned. The returned message parts should be regarded as
read-only (future versions of this library might make it possible
to modify the parent by modifying the parts).
If the content type of $msg is C then there will only be
one part returned.
If the content type is C, then the return value will be
either an C or an C object.
If a @parts argument is given, then the content of the message will be
modified. The array reference form is provided so that an empty list
can be provided. The @parts array should contain C
objects. The @parts objects are owned by $mess after this call and
should not be modified or made part of other messages.
When updating the message with this method and the old content type of
$mess is not C or C, then the content type is
set to C and all other content headers are cleared.
This method will croak if the content type is C and more
than one part is provided.
=item $mess->add_part( $part )
This will add a part to a message. The $part argument should be
another C object. If the previous content type of
$mess is not C then the old content (together with all
content headers) will be made part #1 and the content type made
C before the new part is added. The $part object is
owned by $mess after this call and should not be modified or made part
of other messages.
There is no return value.
=item $mess->clear
Will clear the headers and set the content to the empty string. There
is no return value
=item $mess->protocol
=item $mess->protocol( $proto )
Sets the HTTP protocol used for the message. The protocol() is a string
like C or C.
=item $mess->clone
Returns a copy of the message object.
=item $mess->as_string
=item $mess->as_string( $eol )
Returns the message formatted as a single string.
The optional $eol parameter specifies the line ending sequence to use.
The default is "\n". If no $eol is given then as_string will ensure
that the returned string is newline terminated (even when the message
content is not). No extra newline is appended if an explicit $eol is
passed.
=item $mess->dump( %opt )
Returns the message formatted as a string. In void context print the string.
This differs from C<< $mess->as_string >> in that it escapes the bytes
of the content so that it's safe to print them and it limits how much
content to print. The escapes syntax used is the same as for Perl's
double quoted strings. If there is no content the string "(no
content)" is shown in its place.
Options to influence the output can be passed as key/value pairs. The
following options are recognized:
=over
=item maxlength => $num
How much of the content to show. The default is 512. Set this to 0
for unlimited.
If the content is longer then the string is chopped at the limit and
the string "...\n(### more bytes not shown)" appended.
=item no_content => $str
Replaces the "(no content)" marker.
=item prefix => $str
A string that will be prefixed to each line of the dump.
=back
=back
All methods unknown to C itself are delegated to the
C object that is part of every message. This allows
convenient access to these methods. Refer to L for
details of these methods:
$mess->header( $field => $val )
$mess->push_header( $field => $val )
$mess->init_header( $field => $val )
$mess->remove_header( $field )
$mess->remove_content_headers
$mess->header_field_names
$mess->scan( \&doit )
$mess->date
$mess->expires
$mess->if_modified_since
$mess->if_unmodified_since
$mess->last_modified
$mess->content_type
$mess->content_encoding
$mess->content_length
$mess->content_language
$mess->title
$mess->user_agent
$mess->server
$mess->from
$mess->referer
$mess->www_authenticate
$mess->authorization
$mess->proxy_authorization
$mess->authorization_basic
$mess->proxy_authorization_basic
=head1 AUTHOR
Gisle Aas
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 1994-2017 by Gisle Aas.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__END__
#ABSTRACT: HTTP style message (base class)
HTTP-Message-6.22/lib/HTTP/Headers/ 000755 000765 000024 00000000000 13625016310 017760 5 ustar 00olafalders staff 000000 000000 HTTP-Message-6.22/lib/HTTP/Headers.pm 000644 000765 000024 00000061005 13625016310 020320 0 ustar 00olafalders staff 000000 000000 package HTTP::Headers;
use strict;
use warnings;
our $VERSION = '6.22';
use Carp ();
# The $TRANSLATE_UNDERSCORE variable controls whether '_' can be used
# as a replacement for '-' in header field names.
our $TRANSLATE_UNDERSCORE = 1 unless defined $TRANSLATE_UNDERSCORE;
# "Good Practice" order of HTTP message headers:
# - General-Headers
# - Request-Headers
# - Response-Headers
# - Entity-Headers
my @general_headers = qw(
Cache-Control Connection Date Pragma Trailer Transfer-Encoding Upgrade
Via Warning
);
my @request_headers = qw(
Accept Accept-Charset Accept-Encoding Accept-Language
Authorization Expect From Host
If-Match If-Modified-Since If-None-Match If-Range If-Unmodified-Since
Max-Forwards Proxy-Authorization Range Referer TE User-Agent
);
my @response_headers = qw(
Accept-Ranges Age ETag Location Proxy-Authenticate Retry-After Server
Vary WWW-Authenticate
);
my @entity_headers = qw(
Allow Content-Encoding Content-Language Content-Length Content-Location
Content-MD5 Content-Range Content-Type Expires Last-Modified
);
my %entity_header = map { lc($_) => 1 } @entity_headers;
my @header_order = (
@general_headers,
@request_headers,
@response_headers,
@entity_headers,
);
# Make alternative representations of @header_order. This is used
# for sorting and case matching.
my %header_order;
my %standard_case;
{
my $i = 0;
for (@header_order) {
my $lc = lc $_;
$header_order{$lc} = ++$i;
$standard_case{$lc} = $_;
}
}
sub new
{
my($class) = shift;
my $self = bless {}, $class;
$self->header(@_) if @_; # set up initial headers
$self;
}
sub header
{
my $self = shift;
Carp::croak('Usage: $h->header($field, ...)') unless @_;
my(@old);
my %seen;
while (@_) {
my $field = shift;
my $op = @_ ? ($seen{lc($field)}++ ? 'PUSH' : 'SET') : 'GET';
@old = $self->_header($field, shift, $op);
}
return @old if wantarray;
return $old[0] if @old <= 1;
join(", ", @old);
}
sub clear
{
my $self = shift;
%$self = ();
}
sub push_header
{
my $self = shift;
return $self->_header(@_, 'PUSH_H') if @_ == 2;
while (@_) {
$self->_header(splice(@_, 0, 2), 'PUSH_H');
}
}
sub init_header
{
Carp::croak('Usage: $h->init_header($field, $val)') if @_ != 3;
shift->_header(@_, 'INIT');
}
sub remove_header
{
my($self, @fields) = @_;
my $field;
my @values;
foreach $field (@fields) {
$field =~ tr/_/-/ if $field !~ /^:/ && $TRANSLATE_UNDERSCORE;
my $v = delete $self->{lc $field};
push(@values, ref($v) eq 'ARRAY' ? @$v : $v) if defined $v;
}
return @values;
}
sub remove_content_headers
{
my $self = shift;
unless (defined(wantarray)) {
# fast branch that does not create return object
delete @$self{grep $entity_header{$_} || /^content-/, keys %$self};
return;
}
my $c = ref($self)->new;
for my $f (grep $entity_header{$_} || /^content-/, keys %$self) {
$c->{$f} = delete $self->{$f};
}
if (exists $self->{'::std_case'}) {
$c->{'::std_case'} = $self->{'::std_case'};
}
$c;
}
sub _header
{
my($self, $field, $val, $op) = @_;
Carp::croak("Illegal field name '$field'")
if rindex($field, ':') > 1 || !length($field);
unless ($field =~ /^:/) {
$field =~ tr/_/-/ if $TRANSLATE_UNDERSCORE;
my $old = $field;
$field = lc $field;
unless($standard_case{$field} || $self->{'::std_case'}{$field}) {
# generate a %std_case entry for this field
$old =~ s/\b(\w)/\u$1/g;
$self->{'::std_case'}{$field} = $old;
}
}
$op ||= defined($val) ? 'SET' : 'GET';
if ($op eq 'PUSH_H') {
# Like PUSH but where we don't care about the return value
if (exists $self->{$field}) {
my $h = $self->{$field};
if (ref($h) eq 'ARRAY') {
push(@$h, ref($val) eq "ARRAY" ? @$val : $val);
}
else {
$self->{$field} = [$h, ref($val) eq "ARRAY" ? @$val : $val]
}
return;
}
$self->{$field} = $val;
return;
}
my $h = $self->{$field};
my @old = ref($h) eq 'ARRAY' ? @$h : (defined($h) ? ($h) : ());
unless ($op eq 'GET' || ($op eq 'INIT' && @old)) {
if (defined($val)) {
my @new = ($op eq 'PUSH') ? @old : ();
if (ref($val) ne 'ARRAY') {
push(@new, $val);
}
else {
push(@new, @$val);
}
$self->{$field} = @new > 1 ? \@new : $new[0];
}
elsif ($op ne 'PUSH') {
delete $self->{$field};
}
}
@old;
}
sub _sorted_field_names
{
my $self = shift;
return [ sort {
($header_order{$a} || 999) <=> ($header_order{$b} || 999) ||
$a cmp $b
} grep !/^::/, keys %$self ];
}
sub header_field_names {
my $self = shift;
return map $standard_case{$_} || $self->{'::std_case'}{$_} || $_, @{ $self->_sorted_field_names },
if wantarray;
return grep !/^::/, keys %$self;
}
sub scan
{
my($self, $sub) = @_;
my $key;
for $key (@{ $self->_sorted_field_names }) {
my $vals = $self->{$key};
if (ref($vals) eq 'ARRAY') {
my $val;
for $val (@$vals) {
$sub->($standard_case{$key} || $self->{'::std_case'}{$key} || $key, $val);
}
}
else {
$sub->($standard_case{$key} || $self->{'::std_case'}{$key} || $key, $vals);
}
}
}
sub flatten {
my($self)=@_;
(
map {
my $k = $_;
map {
( $k => $_ )
} $self->header($_);
} $self->header_field_names
);
}
sub as_string
{
my($self, $endl) = @_;
$endl = "\n" unless defined $endl;
my @result = ();
for my $key (@{ $self->_sorted_field_names }) {
next if index($key, '_') == 0;
my $vals = $self->{$key};
if ( ref($vals) eq 'ARRAY' ) {
for my $val (@$vals) {
$val = '' if not defined $val;
my $field = $standard_case{$key} || $self->{'::std_case'}{$key} || $key;
$field =~ s/^://;
if ( index($val, "\n") >= 0 ) {
$val = _process_newline($val, $endl);
}
push @result, $field . ': ' . $val;
}
}
else {
$vals = '' if not defined $vals;
my $field = $standard_case{$key} || $self->{'::std_case'}{$key} || $key;
$field =~ s/^://;
if ( index($vals, "\n") >= 0 ) {
$vals = _process_newline($vals, $endl);
}
push @result, $field . ': ' . $vals;
}
}
join($endl, @result, '');
}
sub _process_newline {
local $_ = shift;
my $endl = shift;
# must handle header values with embedded newlines with care
s/\s+$//; # trailing newlines and space must go
s/\n(\x0d?\n)+/\n/g; # no empty lines
s/\n([^\040\t])/\n $1/g; # initial space for continuation
s/\n/$endl/g; # substitute with requested line ending
$_;
}
if (eval { require Storable; 1 }) {
*clone = \&Storable::dclone;
} else {
*clone = sub {
my $self = shift;
my $clone = HTTP::Headers->new;
$self->scan(sub { $clone->push_header(@_);} );
$clone;
};
}
sub _date_header
{
require HTTP::Date;
my($self, $header, $time) = @_;
my($old) = $self->_header($header);
if (defined $time) {
$self->_header($header, HTTP::Date::time2str($time));
}
$old =~ s/;.*// if defined($old);
HTTP::Date::str2time($old);
}
sub date { shift->_date_header('Date', @_); }
sub expires { shift->_date_header('Expires', @_); }
sub if_modified_since { shift->_date_header('If-Modified-Since', @_); }
sub if_unmodified_since { shift->_date_header('If-Unmodified-Since', @_); }
sub last_modified { shift->_date_header('Last-Modified', @_); }
# This is used as a private LWP extension. The Client-Date header is
# added as a timestamp to a response when it has been received.
sub client_date { shift->_date_header('Client-Date', @_); }
# The retry_after field is dual format (can also be a expressed as
# number of seconds from now), so we don't provide an easy way to
# access it until we have know how both these interfaces can be
# addressed. One possibility is to return a negative value for
# relative seconds and a positive value for epoch based time values.
#sub retry_after { shift->_date_header('Retry-After', @_); }
sub content_type {
my $self = shift;
my $ct = $self->{'content-type'};
$self->{'content-type'} = shift if @_;
$ct = $ct->[0] if ref($ct) eq 'ARRAY';
return '' unless defined($ct) && length($ct);
my @ct = split(/;\s*/, $ct, 2);
for ($ct[0]) {
s/\s+//g;
$_ = lc($_);
}
wantarray ? @ct : $ct[0];
}
sub content_type_charset {
my $self = shift;
require HTTP::Headers::Util;
my $h = $self->{'content-type'};
$h = $h->[0] if ref($h);
$h = "" unless defined $h;
my @v = HTTP::Headers::Util::split_header_words($h);
if (@v) {
my($ct, undef, %ct_param) = @{$v[0]};
my $charset = $ct_param{charset};
if ($ct) {
$ct = lc($ct);
$ct =~ s/\s+//;
}
if ($charset) {
$charset = uc($charset);
$charset =~ s/^\s+//; $charset =~ s/\s+\z//;
undef($charset) if $charset eq "";
}
return $ct, $charset if wantarray;
return $charset;
}
return undef, undef if wantarray;
return undef;
}
sub content_is_text {
my $self = shift;
return $self->content_type =~ m,^text/,;
}
sub content_is_html {
my $self = shift;
return $self->content_type eq 'text/html' || $self->content_is_xhtml;
}
sub content_is_xhtml {
my $ct = shift->content_type;
return $ct eq "application/xhtml+xml" ||
$ct eq "application/vnd.wap.xhtml+xml";
}
sub content_is_xml {
my $ct = shift->content_type;
return 1 if $ct eq "text/xml";
return 1 if $ct eq "application/xml";
return 1 if $ct =~ /\+xml$/;
return 0;
}
sub referer {
my $self = shift;
if (@_ && $_[0] =~ /#/) {
# Strip fragment per RFC 2616, section 14.36.
my $uri = shift;
if (ref($uri)) {
$uri = $uri->clone;
$uri->fragment(undef);
}
else {
$uri =~ s/\#.*//;
}
unshift @_, $uri;
}
($self->_header('Referer', @_))[0];
}
*referrer = \&referer; # on tchrist's request
sub title { (shift->_header('Title', @_))[0] }
sub content_encoding { (shift->_header('Content-Encoding', @_))[0] }
sub content_language { (shift->_header('Content-Language', @_))[0] }
sub content_length { (shift->_header('Content-Length', @_))[0] }
sub user_agent { (shift->_header('User-Agent', @_))[0] }
sub server { (shift->_header('Server', @_))[0] }
sub from { (shift->_header('From', @_))[0] }
sub warning { (shift->_header('Warning', @_))[0] }
sub www_authenticate { (shift->_header('WWW-Authenticate', @_))[0] }
sub authorization { (shift->_header('Authorization', @_))[0] }
sub proxy_authenticate { (shift->_header('Proxy-Authenticate', @_))[0] }
sub proxy_authorization { (shift->_header('Proxy-Authorization', @_))[0] }
sub authorization_basic { shift->_basic_auth("Authorization", @_) }
sub proxy_authorization_basic { shift->_basic_auth("Proxy-Authorization", @_) }
sub _basic_auth {
require MIME::Base64;
my($self, $h, $user, $passwd) = @_;
my($old) = $self->_header($h);
if (defined $user) {
Carp::croak("Basic authorization user name can't contain ':'")
if $user =~ /:/;
$passwd = '' unless defined $passwd;
$self->_header($h => 'Basic ' .
MIME::Base64::encode("$user:$passwd", ''));
}
if (defined $old && $old =~ s/^\s*Basic\s+//) {
my $val = MIME::Base64::decode($old);
return $val unless wantarray;
return split(/:/, $val, 2);
}
return;
}
1;
=pod
=encoding UTF-8
=head1 NAME
HTTP::Headers - Class encapsulating HTTP Message headers
=head1 VERSION
version 6.22
=head1 SYNOPSIS
require HTTP::Headers;
$h = HTTP::Headers->new;
$h->header('Content-Type' => 'text/plain'); # set
$ct = $h->header('Content-Type'); # get
$h->remove_header('Content-Type'); # delete
=head1 DESCRIPTION
The C class encapsulates HTTP-style message headers.
The headers consist of attribute-value pairs also called fields, which
may be repeated, and which are printed in a particular order. The
field names are cases insensitive.
Instances of this class are usually created as member variables of the
C and C classes, internal to the
library.
The following methods are available:
=over 4
=item $h = HTTP::Headers->new
Constructs a new C]