Accepting request 506086 from devel:languages:perl

1

OBS-URL: https://build.opensuse.org/request/show/506086
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/perl-HTTP-Message?expand=0&rev=16
This commit is contained in:
Dominique Leuenberger 2017-06-27 08:20:39 +00:00 committed by Git OBS Bridge
commit 7d1e4aed8f
4 changed files with 158 additions and 148 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e7b368077ae6a188d99920411d8f52a8e5acfb39574d4f5c24f46fd22533d81b
size 59981

3
HTTP-Message-6.13.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f25f38428de851e5661e72f124476494852eb30812358b07f1c3a289f6f5eded
size 74413

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 21 05:46:21 UTC 2017 - coolo@suse.com
- updated to 6.13
see /usr/share/doc/packages/perl-HTTP-Message/Changes
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Sep 10 09:44:07 UTC 2015 - coolo@suse.com Thu Sep 10 09:44:07 UTC 2015 - coolo@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package perl-HTTP-Message # spec file for package perl-HTTP-Message
# #
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,14 +17,14 @@
Name: perl-HTTP-Message Name: perl-HTTP-Message
Version: 6.11 Version: 6.13
Release: 0 Release: 0
%define cpan_name HTTP-Message %define cpan_name HTTP-Message
Summary: HTTP style message (base class) Summary: HTTP style message (base class)
License: Artistic-1.0 or GPL-1.0+ License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/HTTP-Message/ Url: http://search.cpan.org/dist/HTTP-Message/
Source0: http://www.cpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz Source0: https://cpan.metacpan.org/authors/id/O/OA/OALDERS/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml Source1: cpanspec.yml
BuildArch: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -43,6 +43,8 @@ BuildRequires: perl(IO::Uncompress::Gunzip)
BuildRequires: perl(IO::Uncompress::Inflate) BuildRequires: perl(IO::Uncompress::Inflate)
BuildRequires: perl(IO::Uncompress::RawInflate) BuildRequires: perl(IO::Uncompress::RawInflate)
BuildRequires: perl(LWP::MediaTypes) >= 6 BuildRequires: perl(LWP::MediaTypes) >= 6
BuildRequires: perl(Test::More) >= 0.88
BuildRequires: perl(Try::Tiny)
BuildRequires: perl(URI) >= 1.10 BuildRequires: perl(URI) >= 1.10
Requires: perl(Compress::Raw::Zlib) Requires: perl(Compress::Raw::Zlib)
Requires: perl(Encode) >= 2.21 Requires: perl(Encode) >= 2.21
@ -70,167 +72,168 @@ following methods are available:
* $mess = HTTP::Message->new( $headers, $content ) * $mess = HTTP::Message->new( $headers, $content )
This constructs a new message object. Normally you would want construct This constructs a new message object. Normally you would want construct
'HTTP::Request' or 'HTTP::Response' objects instead. 'HTTP::Request' or 'HTTP::Response' objects instead.
The optional $header argument should be a reference to an 'HTTP::Headers' The optional $header argument should be a reference to an 'HTTP::Headers'
object or a plain array reference of key/value pairs. If an object or a plain array reference of key/value pairs. If an 'HTTP::Headers'
'HTTP::Headers' object is provided then a copy of it will be embedded object is provided then a copy of it will be embedded into the constructed
into the constructed message, i.e. it will not be owned and can be message, i.e. it will not be owned and can be modified afterwards without
modified afterwards without affecting the message. affecting the message.
The optional $content argument should be a string of bytes. The optional $content argument should be a string of bytes.
* $mess = HTTP::Message->parse( $str ) * $mess = HTTP::Message->parse( $str )
This constructs a new message object by parsing the given string. This constructs a new message object by parsing the given string.
* $mess->headers * $mess->headers
Returns the embedded 'HTTP::Headers' object. Returns the embedded 'HTTP::Headers' object.
* $mess->headers_as_string * $mess->headers_as_string
* $mess->headers_as_string( $eol ) * $mess->headers_as_string( $eol )
Call the as_string() method for the headers in the message. This will be Call the as_string() method for the headers in the message. This will be
the same as the same as
$mess->headers->as_string $mess->headers->as_string
but it will make your program a whole character shorter :-) but it will make your program a whole character shorter :-)
* $mess->content * $mess->content
* $mess->content( $bytes ) * $mess->content( $bytes )
The content() method sets the raw content if an argument is given. If no 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 argument is given the content is not touched. In either case the original
raw content is returned. raw content is returned.
Note that the content should be a string of bytes. Strings in perl can If the 'undef' argument is given, the content is reset to its default
contain characters outside the range of a byte. The 'Encode' module can value, which is an empty string.
be used to turn such strings into a string of bytes.
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 ) * $mess->add_content( $bytes )
The add_content() methods appends more data bytes to the end of the The add_content() methods appends more data bytes to the end of the current
current content buffer. content buffer.
* $mess->add_content_utf8( $string ) * $mess->add_content_utf8( $string )
The add_content_utf8() method appends the UTF-8 bytes representing the The add_content_utf8() method appends the UTF-8 bytes representing the
string to the end of the current content buffer. string to the end of the current content buffer.
* $mess->content_ref * $mess->content_ref
* $mess->content_ref( \$bytes ) * $mess->content_ref( \$bytes )
The content_ref() method will return a reference to content buffer The content_ref() method will return a reference to content buffer string.
string. It can be more efficient to access the content this way if the It can be more efficient to access the content this way if the content is
content is huge, and it can even be used for direct manipulation of the huge, and it can even be used for direct manipulation of the content, for
content, for instance: instance:
${$res->content_ref} =~ s/\bfoo\b/bar/g; ${$res->content_ref} =~ s/\bfoo\b/bar/g;
This example would modify the content buffer in-place. This example would modify the content buffer in-place.
If an argument is passed it will setup the content to reference some If an argument is passed it will setup the content to reference some
external source. The content() and add_content() methods will external source. The content() and add_content() methods will automatically
automatically dereference scalar references passed this way. For other dereference scalar references passed this way. For other references
references content() will return the reference itself and add_content() content() will return the reference itself and add_content() will refuse to
will refuse to do anything. do anything.
* $mess->content_charset * $mess->content_charset
This returns the charset used by the content in the message. The charset This returns the charset used by the content in the message. The charset is
is either found as the charset attribute of the 'Content-Type' header or either found as the charset attribute of the 'Content-Type' header or by
by guessing. guessing.
See the http://www.w3.org/TR/REC-html40/charset.html#spec-char-encoding See http://www.w3.org/TR/REC-html40/charset.html#spec-char-encoding for
manpage for details about how charset is determined. details about how charset is determined.
* $mess->decoded_content( %options ) * $mess->decoded_content( %options )
Returns the content with any 'Content-Encoding' undone and for textual Returns the content with any 'Content-Encoding' undone and for textual
content the raw content encoded to Perl's Unicode strings. If the content the raw content encoded to Perl's Unicode strings. If the
'Content-Encoding' or 'charset' of the message is unknown this method 'Content-Encoding' or 'charset' of the message is unknown this method will
will fail by returning 'undef'. fail by returning 'undef'.
The following options can be specified. The following options can be specified.
* 'charset' * 'charset'
This override the charset parameter for text content. The value 'none' This override the charset parameter for text content. The value 'none' can
can used to suppress decoding of the charset. used to suppress decoding of the charset.
* 'default_charset' * 'default_charset'
This override the default charset guessed by content_charset() or if This override the default charset guessed by content_charset() or if that
that fails "ISO-8859-1". fails "ISO-8859-1".
* 'alt_charset' * 'alt_charset'
If decoding fails because the charset specified in the Content-Type If decoding fails because the charset specified in the Content-Type header
header isn't recognized by Perl's Encode module, then try decoding isn't recognized by Perl's Encode module, then try decoding using this
using this charset instead of failing. The 'alt_charset' might be charset instead of failing. The 'alt_charset' might be specified as 'none'
specified as 'none' to simply return the string without any decoding of to simply return the string without any decoding of charset as alternative.
charset as alternative.
* 'charset_strict' * 'charset_strict'
Abort decoding if malformed characters is found in the content. By Abort decoding if malformed characters is found in the content. By default
default you get the substitution character ("\x{FFFD}") in place of you get the substitution character ("\x{FFFD}") in place of malformed
malformed characters. characters.
* 'raise_error' * 'raise_error'
If TRUE then raise an exception if not able to decode content. Reason If TRUE then raise an exception if not able to decode content. Reason might
might be that the specified 'Content-Encoding' or 'charset' is not be that the specified 'Content-Encoding' or 'charset' is not supported. If
supported. If this option is FALSE, then decoded_content() will return this option is FALSE, then decoded_content() will return 'undef' on errors,
'undef' on errors, but will still set $@. but will still set $@.
* 'ref' * 'ref'
If TRUE then a reference to decoded content is returned. This might be If TRUE then a reference to decoded content is returned. This might be more
more efficient in cases where the decoded content is identical to the efficient in cases where the decoded content is identical to the raw
raw content as no data copying is required in this case. content as no data copying is required in this case.
* $mess->decodable * $mess->decodable
* HTTP::Message::decodable() * HTTP::Message::decodable()
This returns the encoding identifiers that decoded_content() can process. This returns the encoding identifiers that decoded_content() can process.
In scalar context returns a comma separated string of identifiers. In scalar context returns a comma separated string of identifiers.
This value is suitable for initializing the 'Accept-Encoding' request This value is suitable for initializing the 'Accept-Encoding' request
header field. header field.
* $mess->decode * $mess->decode
This method tries to replace the content of the message with the decoded This method tries to replace the content of the message with the decoded
version and removes the 'Content-Encoding' header. Returns TRUE if version and removes the 'Content-Encoding' header. Returns TRUE if
successful and FALSE if not. successful and FALSE if not.
If the message does not have a 'Content-Encoding' header this method does If the message does not have a 'Content-Encoding' header this method does
nothing and returns TRUE. nothing and returns TRUE.
Note that the content of the message is still bytes after this method has 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 been called and you still need to call decoded_content() if you want to
process its content as a string. process its content as a string.
* $mess->encode( $encoding, ... ) * $mess->encode( $encoding, ... )
Apply the given encodings to the content of the message. Returns TRUE if Apply the given encodings to the content of the message. Returns TRUE if
successful. The "identity" (non-)encoding is always supported; other successful. The "identity" (non-)encoding is always supported; other
currently supported encodings, subject to availability of required currently supported encodings, subject to availability of required
additional modules, are "gzip", "deflate", "x-bzip2" and "base64". additional modules, are "gzip", "deflate", "x-bzip2" and "base64".
A successful call to this function will set the 'Content-Encoding' A successful call to this function will set the 'Content-Encoding' header.
header.
Note that 'multipart/*' or 'message/*' messages can't be encoded and this Note that 'multipart/*' or 'message/*' messages can't be encoded and this
method will croak if you try. method will croak if you try.
* $mess->parts * $mess->parts
@ -238,108 +241,108 @@ following methods are available:
* $mess->parts( \@parts ) * $mess->parts( \@parts )
Messages can be composite, i.e. contain other messages. The composite Messages can be composite, i.e. contain other messages. The composite
messages have a content type of 'multipart/*' or 'message/*'. This method messages have a content type of 'multipart/*' or 'message/*'. This method
give access to the contained messages. give access to the contained messages.
The argumentless form will return a list of 'HTTP::Message' objects. If The argumentless form will return a list of 'HTTP::Message' objects. If the
the content type of $msg is not 'multipart/*' or 'message/*' then this content type of $msg is not 'multipart/*' or 'message/*' then this will
will return the empty list. In scalar context only the first object is return the empty list. In scalar context only the first object is returned.
returned. The returned message parts should be regarded as read-only The returned message parts should be regarded as read-only (future versions
(future versions of this library might make it possible to modify the of this library might make it possible to modify the parent by modifying
parent by modifying the parts). the parts).
If the content type of $msg is 'message/*' then there will only be one If the content type of $msg is 'message/*' then there will only be one part
part returned. returned.
If the content type is 'message/http', then the return value will be If the content type is 'message/http', then the return value will be either
either an 'HTTP::Request' or an 'HTTP::Response' object. an 'HTTP::Request' or an 'HTTP::Response' object.
If a @parts argument is given, then the content of the message will be 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 modified. The array reference form is provided so that an empty list can be
be provided. The @parts array should contain 'HTTP::Message' objects. The provided. The @parts array should contain 'HTTP::Message' objects. The
@parts objects are owned by $mess after this call and should not be @parts objects are owned by $mess after this call and should not be
modified or made part of other messages. modified or made part of other messages.
When updating the message with this method and the old content type of 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 $mess is not 'multipart/*' or 'message/*', then the content type is set to
to 'multipart/mixed' and all other content headers are cleared. 'multipart/mixed' and all other content headers are cleared.
This method will croak if the content type is 'message/*' and more than This method will croak if the content type is 'message/*' and more than one
one part is provided. part is provided.
* $mess->add_part( $part ) * $mess->add_part( $part )
This will add a part to a message. The $part argument should be another 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 'HTTP::Message' object. If the previous content type of $mess is not
'multipart/*' then the old content (together with all content headers) 'multipart/*' then the old content (together with all content headers) will
will be made part #1 and the content type made 'multipart/mixed' before be made part #1 and the content type made 'multipart/mixed' before the new
the new part is added. The $part object is owned by $mess after this call part is added. The $part object is owned by $mess after this call and
and should not be modified or made part of other messages. should not be modified or made part of other messages.
There is no return value. There is no return value.
* $mess->clear * $mess->clear
Will clear the headers and set the content to the empty string. There is Will clear the headers and set the content to the empty string. There is no
no return value return value
* $mess->protocol * $mess->protocol
* $mess->protocol( $proto ) * $mess->protocol( $proto )
Sets the HTTP protocol used for the message. The protocol() is a string Sets the HTTP protocol used for the message. The protocol() is a string
like 'HTTP/1.0' or 'HTTP/1.1'. like 'HTTP/1.0' or 'HTTP/1.1'.
* $mess->clone * $mess->clone
Returns a copy of the message object. Returns a copy of the message object.
* $mess->as_string * $mess->as_string
* $mess->as_string( $eol ) * $mess->as_string( $eol )
Returns the message formatted as a single string. Returns the message formatted as a single string.
The optional $eol parameter specifies the line ending sequence to use. The optional $eol parameter specifies the line ending sequence to use. The
The default is "\n". If no $eol is given then as_string will ensure that default is "\n". If no $eol is given then as_string will ensure that the
the returned string is newline terminated (even when the message content returned string is newline terminated (even when the message content is
is not). No extra newline is appended if an explicit $eol is passed. not). No extra newline is appended if an explicit $eol is passed.
* $mess->dump( %opt ) * $mess->dump( %opt )
Returns the message formatted as a string. In void context print the Returns the message formatted as a string. In void context print the
string. string.
This differs from '$mess->as_string' in that it escapes the bytes of the 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 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 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 strings. If there is no content the string "(no content)" is shown in its
place. place.
Options to influence the output can be passed as key/value pairs. The Options to influence the output can be passed as key/value pairs. The
following options are recognized: following options are recognized:
* maxlength => $num * maxlength => $num
How much of the content to show. The default is 512. Set this to 0 for How much of the content to show. The default is 512. Set this to 0 for
unlimited. unlimited.
If the content is longer then the string is chopped at the limit and If the content is longer then the string is chopped at the limit and the
the string "...\n(### more bytes not shown)" appended. string "...\n(### more bytes not shown)" appended.
* no_content => $str * no_content => $str
Replaces the "(no content)" marker. Replaces the "(no content)" marker.
* prefix => $str * prefix => $str
A string that will be prefixed to each line of the dump. A string that will be prefixed to each line of the dump.
All methods unknown to 'HTTP::Message' itself are delegated to the All methods unknown to 'HTTP::Message' itself are delegated to the
'HTTP::Headers' object that is part of every message. This allows 'HTTP::Headers' object that is part of every message. This allows
convenient access to these methods. Refer to the HTTP::Headers manpage for convenient access to these methods. Refer to HTTP::Headers for details of
details of these methods: these methods:
$mess->header( $field => $val ) $mess->header( $field => $val )
$mess->push_header( $field => $val ) $mess->push_header( $field => $val )
@ -386,6 +389,7 @@ details of these methods:
%files -f %{name}.files %files -f %{name}.files
%defattr(-,root,root,755) %defattr(-,root,root,755)
%doc Changes LICENSE README %doc Changes CONTRIBUTORS README.md
%license LICENSE
%changelog %changelog