summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/site/lib/HTTP/Message.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/site/lib/HTTP/Message.pm')
-rw-r--r--Master/tlpkg/tlperl/site/lib/HTTP/Message.pm41
1 files changed, 30 insertions, 11 deletions
diff --git a/Master/tlpkg/tlperl/site/lib/HTTP/Message.pm b/Master/tlpkg/tlperl/site/lib/HTTP/Message.pm
index c5ba281a487..27c455e0d25 100644
--- a/Master/tlpkg/tlperl/site/lib/HTTP/Message.pm
+++ b/Master/tlpkg/tlperl/site/lib/HTTP/Message.pm
@@ -3,7 +3,7 @@ package HTTP::Message;
use strict;
use warnings;
-our $VERSION = "6.11";
+our $VERSION = '6.14';
require HTTP::Headers;
require Carp;
@@ -143,11 +143,11 @@ sub _set_content {
my $self = $_[0];
_utf8_downgrade($_[1]);
if (!ref($_[1]) && ref($self->{_content}) eq "SCALAR") {
- ${$self->{_content}} = $_[1];
+ ${$self->{_content}} = defined( $_[1] ) ? $_[1] : '';
}
else {
die "Can't set content to be a scalar reference" if ref($_[1]) eq "SCALAR";
- $self->{_content} = $_[1];
+ $self->{_content} = defined( $_[1] ) ? $_[1] : '';
delete $self->{_content_ref};
}
delete $self->{_parts} unless $_[2];
@@ -430,7 +430,7 @@ sub decodable
};
eval {
require IO::Uncompress::Bunzip2;
- push(@enc, "x-bzip2");
+ push(@enc, "x-bzip2", "bzip2");
};
# we don't care about announcing the 'identity', 'base64' and
# 'quoted-printable' stuff
@@ -462,7 +462,7 @@ sub encode
my $content = $self->content;
for my $encoding (@enc) {
- if ($encoding eq "identity") {
+ if ($encoding eq "identity" || $encoding eq "none") {
# nothing to do
}
elsif ($encoding eq "base64") {
@@ -483,7 +483,7 @@ sub encode
or die "Can't deflate content: $IO::Compress::Deflate::DeflateError";
$content = $output;
}
- elsif ($encoding eq "x-bzip2") {
+ elsif ($encoding eq "x-bzip2" || $encoding eq "bzip2") {
require IO::Compress::Bzip2;
my $output;
IO::Compress::Bzip2::bzip2(\$content, \$output)
@@ -771,13 +771,18 @@ sub _boundary
1;
+=pod
-__END__
+=encoding UTF-8
=head1 NAME
HTTP::Message - HTTP style message (base class)
+=head1 VERSION
+
+version 6.14
+
=head1 SYNOPSIS
use base 'HTTP::Message';
@@ -833,6 +838,9 @@ 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<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 C<Encode>
module can be used to turn such strings into a string of bytes.
@@ -1105,10 +1113,21 @@ details of these methods:
$mess->authorization_basic
$mess->proxy_authorization_basic
-=head1 COPYRIGHT
+=head1 AUTHOR
+
+Gisle Aas <gisle@activestate.com>
+
+=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__
-Copyright 1995-2004 Gisle Aas.
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
+#ABSTRACT: HTTP style message (base class)