Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2016-10-31 09:53:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old) and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes 2016-10-10 17:31:34.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2016-10-31 09:53:32.000000000 +0100 @@ -1,0 +2,11 @@ +Mon Oct 24 05:53:29 UTC 2016 - [email protected] + +- updated to 7.09 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 7.09 2016-10-22 + - Added every_header method to Mojo::Headers. + - Fixed redirect bug in Mojo::UserAgent::Transactor. + - Fixed a few proxy bugs in Mojo::UserAgent. + +------------------------------------------------------------------- Old: ---- Mojolicious-7.08.tar.gz New: ---- Mojolicious-7.09.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.M1zLYt/_old 2016-10-31 09:53:33.000000000 +0100 +++ /var/tmp/diff_new_pack.M1zLYt/_new 2016-10-31 09:53:33.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Mojolicious -Version: 7.08 +Version: 7.09 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework ++++++ Mojolicious-7.08.tar.gz -> Mojolicious-7.09.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/Changes new/Mojolicious-7.09/Changes --- old/Mojolicious-7.08/Changes 2016-09-23 14:49:49.000000000 +0200 +++ new/Mojolicious-7.09/Changes 2016-10-22 18:59:15.000000000 +0200 @@ -1,4 +1,9 @@ +7.09 2016-10-22 + - Added every_header method to Mojo::Headers. + - Fixed redirect bug in Mojo::UserAgent::Transactor. + - Fixed a few proxy bugs in Mojo::UserAgent. + 7.08 2016-09-23 - Added -i and -o options to get command. - Updated jQuery to version 3.1.1. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/META.json new/Mojolicious-7.09/META.json --- old/Mojolicious-7.08/META.json 2016-09-23 19:18:40.000000000 +0200 +++ new/Mojolicious-7.09/META.json 2016-10-23 11:45:53.000000000 +0200 @@ -58,6 +58,6 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "7.08", + "version" : "7.09", "x_serialization_backend" : "JSON::PP version 2.27400" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/META.yml new/Mojolicious-7.09/META.yml --- old/Mojolicious-7.08/META.yml 2016-09-23 19:18:40.000000000 +0200 +++ new/Mojolicious-7.09/META.yml 2016-10-23 11:45:52.000000000 +0200 @@ -31,5 +31,5 @@ homepage: http://mojolicious.org license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo.git -version: '7.08' +version: '7.09' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojo/Headers.pm new/Mojolicious-7.09/lib/Mojo/Headers.pm --- old/Mojolicious-7.08/lib/Mojo/Headers.pm 2016-08-23 13:24:27.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojo/Headers.pm 2016-10-22 18:58:03.000000000 +0200 @@ -49,6 +49,8 @@ sub clone { $_[0]->new->from_hash($_[0]->to_hash(1)) } +sub every_header { shift->{headers}{lc shift} || [] } + sub from_hash { my ($self, $hash) = @_; @@ -396,6 +398,16 @@ Get or replace current header value, shortcut for the C<ETag> header. +=head2 every_header + + my $all = $headers->every_header('Location'); + +Similar to L</"header">, but returns all headers sharing the same name as an +array reference. + + # Get first header value + say $headers->every_header('Location')->[0]; + =head2 expect my $expect = $headers->expect; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojo/IOLoop/Client.pm new/Mojolicious-7.09/lib/Mojo/IOLoop/Client.pm --- old/Mojolicious-7.08/lib/Mojo/IOLoop/Client.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojo/IOLoop/Client.pm 2016-10-22 19:31:42.000000000 +0200 @@ -96,7 +96,7 @@ # Socket changes in between attempts and needs to be re-added for epoll/kqueue my $handle = $self->{handle}; - if ($handle->isa('IO::Socket::IP') && !$handle->connect) { + unless ($handle->connect) { return $self->emit(error => $!) unless $! == EINPROGRESS; $self->reactor->remove($handle); return $self->_wait($handle, $args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojo/Log.pm new/Mojolicious-7.09/lib/Mojo/Log.pm --- old/Mojolicious-7.08/lib/Mojo/Log.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojo/Log.pm 2016-10-06 21:27:55.000000000 +0200 @@ -3,7 +3,7 @@ use Carp 'croak'; use Fcntl ':flock'; -use Mojo::Util qw(encode monkey_patch); +use Mojo::Util 'encode'; has format => sub { \&_format }; has handle => sub { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojo/Message/Response.pm new/Mojolicious-7.09/lib/Mojo/Message/Response.pm --- old/Mojolicious-7.08/lib/Mojo/Message/Response.pm 2016-09-23 00:11:31.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojo/Message/Response.pm 2016-10-22 19:05:33.000000000 +0200 @@ -76,8 +76,7 @@ # Parse cookies my $headers = $self->headers; - return [map { @{Mojo::Cookie::Response->parse($_)} } $headers->set_cookie] - unless @_; + return [@{Mojo::Cookie::Response->parse($headers->set_cookie)}] unless @_; # Add cookies $headers->add('Set-Cookie' => "$_") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojo/UserAgent/Transactor.pm new/Mojolicious-7.09/lib/Mojo/UserAgent/Transactor.pm --- old/Mojolicious-7.08/lib/Mojo/UserAgent/Transactor.pm 2016-09-18 11:05:57.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojo/UserAgent/Transactor.pm 2016-10-22 18:55:22.000000000 +0200 @@ -76,7 +76,8 @@ return undef if uc $req->method eq 'CONNECT'; # Fix location without authority and/or scheme - return undef unless my $location = $res->headers->location; + return undef + unless my $location = $res->headers->every_header('Location')->[0]; $location = Mojo::URL->new($location); $location = $location->base($req->url)->to_abs unless $location->is_abs; my $proto = $location->protocol; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojo/UserAgent.pm new/Mojolicious-7.09/lib/Mojo/UserAgent.pm --- old/Mojolicious-7.08/lib/Mojo/UserAgent.pm 2016-09-23 14:46:57.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojo/UserAgent.pm 2016-10-16 11:27:02.000000000 +0200 @@ -130,7 +130,7 @@ my $id = $tx->connection; if ($tx->error || !$tx->res->is_status_class(200) || !$tx->keep_alive) { $old->res->error({message => 'Proxy connection failed'}); - $self->_remove($id); + $self->_remove($id) if $id; return $self->$cb($old); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojolicious/Guides/Contributing.pod new/Mojolicious-7.09/lib/Mojolicious/Guides/Contributing.pod --- old/Mojolicious-7.08/lib/Mojolicious/Guides/Contributing.pod 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojolicious/Guides/Contributing.pod 2016-09-24 11:22:21.000000000 +0200 @@ -182,7 +182,6 @@ sustainable without proper financial backing. You can support the ongoing development of L<Mojolicious> through L<Gratipay|https://gratipay.com/mojolicious>, -L<Bountysource|https://www.bountysource.com/teams/mojolicious>, L<PayPal|https://www.paypal.me/kraih> or Bitcoin (C<1Cid78CmK4hvf78Ry8K2XeDx8pQHNh4hbz>). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/lib/Mojolicious.pm new/Mojolicious-7.09/lib/Mojolicious.pm --- old/Mojolicious-7.08/lib/Mojolicious.pm 2016-09-22 22:27:28.000000000 +0200 +++ new/Mojolicious-7.09/lib/Mojolicious.pm 2016-10-11 22:06:39.000000000 +0200 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Doughnut'; -our $VERSION = '7.08'; +our $VERSION = '7.09'; sub AUTOLOAD { my $self = shift; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/t/mojo/headers.t new/Mojolicious-7.09/t/mojo/headers.t --- old/Mojolicious-7.08/t/mojo/headers.t 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.09/t/mojo/headers.t 2016-10-22 19:00:29.000000000 +0200 @@ -7,6 +7,8 @@ my $headers = Mojo::Headers->new; $headers->add(Connection => 'close'); $headers->add(Connection => 'keep-alive'); +is_deeply $headers->every_header('Connection'), ['close', 'keep-alive'], + 'right structure'; is $headers->header('Connection'), 'close, keep-alive', 'right value'; $headers->remove('Connection'); is $headers->header('Connection'), undef, 'no value'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/t/mojo/transactor.t new/Mojolicious-7.09/t/mojo/transactor.t --- old/Mojolicious-7.08/t/mojo/transactor.t 2016-09-18 10:42:58.000000000 +0200 +++ new/Mojolicious-7.09/t/mojo/transactor.t 2016-10-22 18:55:28.000000000 +0200 @@ -892,6 +892,19 @@ $tx->res->headers->location('http:'); is $t->redirect($tx), undef, 'unsupported redirect'; +# 302 redirect with multiple locations +$tx = $t->tx(GET => 'http://mojolicious.org/foo'); +$tx->res->code(302); +$tx->res->headers->add(Location => 'http://example.com/1.html'); +$tx->res->headers->add(Location => 'http://example.com/2.html'); +$tx = $t->redirect($tx); +is $tx->req->method, 'GET', 'right method'; +is $tx->req->url->to_abs, 'http://example.com/1.html', 'right URL'; +is $tx->req->headers->location, undef, 'no "Location" value'; +is $tx->req->body, '', 'no content'; +is $tx->res->code, undef, 'no status'; +is $tx->res->headers->location, undef, 'no "Location" value'; + # 302 redirect (relative path and query) $tx = $t->tx(POST => 'http://mojolicious.org/foo/bar?a=b' => {Accept => 'application/json'}); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.08/t/mojo/websocket_proxy_tls.t new/Mojolicious-7.09/t/mojo/websocket_proxy_tls.t --- old/Mojolicious-7.08/t/mojo/websocket_proxy_tls.t 2016-08-12 11:19:15.000000000 +0200 +++ new/Mojolicious-7.09/t/mojo/websocket_proxy_tls.t 2016-10-16 11:29:33.000000000 +0200 @@ -297,4 +297,26 @@ is $tx->res->code, 200, 'right status'; is $tx->res->body, "https://127.0.0.1:$port/proxy", 'right content'; +# Blocking request to bad proxy +$ua = Mojo::UserAgent->new; +$proxy = Mojo::IOLoop::Server->generate_port; +$ua->proxy->https("http://127.0.0.1:$proxy"); +$tx = $ua->get("https://127.0.0.1:$port/proxy"); +ok !$tx->success, 'no success'; +is $tx->error->{message}, 'Proxy connection failed', 'right error'; + +# Non-blocking request to bad proxy +($success, $err) = (); +$ua->get( + "https://127.0.0.1:$port/proxy" => sub { + my ($ua, $tx) = @_; + $success = $tx->success; + $err = $tx->error; + Mojo::IOLoop->stop; + } +); +Mojo::IOLoop->start; +ok !$success, 'no success'; +is $err->{message}, 'Proxy connection failed', 'right error'; + done_testing();
