Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2015-04-27 13:05:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2015-04-15 16:25:51.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2015-04-27 13:05:25.000000000 +0200 @@ -1,0 +2,30 @@ +Mon Apr 27 05:49:57 UTC 2015 - co...@suse.com + +- updated to 6.10 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.10 2015-04-26 + - Removed support for user/group switching, because it never worked + correctly, which means that this security feature has become an attack + vector itself. If you depend on this functionality, you can now use the + CPAN module Mojolicious::Plugin::SetUserGroup instead. + - Removed group and user attributes from Mojo::Server. + - Removed setuidgid method from Mojo::Server. + - Removed group and user settings from Hypnotoad. + - Removed -g/--group and -u/--user options from daemon and prefork commands. + - Added next_tick method to Mojo::Reactor::Poll. + - Improved next_tick callbacks to run in the same order in which they were + registered. + +------------------------------------------------------------------- +Sun Apr 26 07:34:53 UTC 2015 - co...@suse.com + +- updated to 6.09 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.09 2015-04-25 + - Improved HTML Living Standard compliance of Mojo::Parameters. (riche, sri) + - Fixed bug in Mojolicious::Types where the json MIME type did not specify a + charset. (kaktus) + +------------------------------------------------------------------- Old: ---- Mojolicious-6.08.tar.gz New: ---- Mojolicious-6.10.tar.gz cpanspec.yml ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.7E6KtL/_old 2015-04-27 13:05:26.000000000 +0200 +++ /var/tmp/diff_new_pack.7E6KtL/_new 2015-04-27 13:05:26.000000000 +0200 @@ -17,14 +17,15 @@ Name: perl-Mojolicious -Version: 6.08 +Version: 6.10 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework License: Artistic-2.0 Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Mojolicious/ -Source: http://www.cpan.org/authors/id/S/SR/SRI/%{cpan_name}-%{version}.tar.gz +Source0: http://www.cpan.org/authors/id/S/SR/SRI/%{cpan_name}-%{version}.tar.gz +Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl ++++++ Mojolicious-6.08.tar.gz -> Mojolicious-6.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/Changes new/Mojolicious-6.10/Changes --- old/Mojolicious-6.08/Changes 2015-04-09 16:33:55.000000000 +0200 +++ new/Mojolicious-6.10/Changes 2015-04-27 02:48:43.000000000 +0200 @@ -1,4 +1,22 @@ +6.10 2015-04-26 + - Removed support for user/group switching, because it never worked + correctly, which means that this security feature has become an attack + vector itself. If you depend on this functionality, you can now use the + CPAN module Mojolicious::Plugin::SetUserGroup instead. + - Removed group and user attributes from Mojo::Server. + - Removed setuidgid method from Mojo::Server. + - Removed group and user settings from Hypnotoad. + - Removed -g/--group and -u/--user options from daemon and prefork commands. + - Added next_tick method to Mojo::Reactor::Poll. + - Improved next_tick callbacks to run in the same order in which they were + registered. + +6.09 2015-04-25 + - Improved HTML Living Standard compliance of Mojo::Parameters. (riche, sri) + - Fixed bug in Mojolicious::Types where the json MIME type did not specify a + charset. (kaktus) + 6.08 2015-04-09 - Added is_established and server_open methods to Mojo::Transaction::WebSocket. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/META.json new/Mojolicious-6.10/META.json --- old/Mojolicious-6.08/META.json 2015-04-10 00:02:53.000000000 +0200 +++ new/Mojolicious-6.10/META.json 2015-04-27 03:59:46.000000000 +0200 @@ -54,5 +54,5 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "6.08" + "version" : "6.10" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/META.yml new/Mojolicious-6.10/META.yml --- old/Mojolicious-6.08/META.yml 2015-04-10 00:02:52.000000000 +0200 +++ new/Mojolicious-6.10/META.yml 2015-04-27 03:59:46.000000000 +0200 @@ -29,4 +29,4 @@ homepage: http://mojolicio.us license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo.git -version: '6.08' +version: '6.10' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/IOLoop.pm new/Mojolicious-6.10/lib/Mojo/IOLoop.pm --- old/Mojolicious-6.08/lib/Mojo/IOLoop.pm 2015-03-23 05:15:08.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojo/IOLoop.pm 2015-04-26 23:27:52.000000000 +0200 @@ -476,8 +476,8 @@ my $undef = Mojo::IOLoop->next_tick(sub {...}); my $undef = $loop->next_tick(sub {...}); -Invoke callback as soon as possible, but not before returning, always returns -C<undef>. +Invoke callback as soon as possible, but not before returning or other +callbacks that have been registered with this method, always returns C<undef>. # Perform operation on next reactor tick Mojo::IOLoop->next_tick(sub { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Message/Response.pm new/Mojolicious-6.10/lib/Mojo/Message/Response.pm --- old/Mojolicious-6.08/lib/Mojo/Message/Response.pm 2015-04-08 02:44:48.000000000 +0200 +++ new/Mojolicious-6.10/lib/Mojo/Message/Response.pm 2015-04-10 04:56:09.000000000 +0200 @@ -28,7 +28,7 @@ 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', - 308 => 'Permanent Redirect', # RFC 7238 + 308 => 'Permanent Redirect', # RFC 7538 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Parameters.pm new/Mojolicious-6.10/lib/Mojo/Parameters.pm --- old/Mojolicious-6.08/lib/Mojo/Parameters.pm 2015-03-16 03:49:22.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojo/Parameters.pm 2015-04-22 21:48:04.000000000 +0200 @@ -151,14 +151,14 @@ sub to_string { my $self = shift; - # String + # String (RFC 3986) my $charset = $self->charset; if (defined(my $str = $self->{string})) { $str = encode $charset, $str if $charset; - return url_escape $str, '^A-Za-z0-9\-._~!$&\'()*+,;=%:@/?'; + return url_escape $str, '^A-Za-z0-9\-._~%!$&\'()*+,;=:@/?'; } - # Build pairs + # Build pairs (HTML Living Standard) my $pairs = $self->pairs; return '' unless @$pairs; my @pairs; @@ -167,9 +167,9 @@ # Escape and replace whitespace with "+" $name = encode $charset, $name if $charset; - $name = url_escape $name, '^A-Za-z0-9\-._~!$\'()*,:@/?'; + $name = url_escape $name, '^*\-.0-9A-Z_a-z'; $value = encode $charset, $value if $charset; - $value = url_escape $value, '^A-Za-z0-9\-._~!$\'()*,:@/?'; + $value = url_escape $value, '^*\-.0-9A-Z_a-z'; s/\%20/\+/g for $name, $value; push @pairs, "$name=$value"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Reactor/Poll.pm new/Mojolicious-6.10/lib/Mojo/Reactor/Poll.pm --- old/Mojolicious-6.08/lib/Mojo/Reactor/Poll.pm 2015-03-22 00:49:59.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojo/Reactor/Poll.pm 2015-04-27 03:01:29.000000000 +0200 @@ -20,6 +20,13 @@ sub is_running { !!shift->{running} } +sub next_tick { + my ($self, $cb) = @_; + push @{$self->{next_tick}}, $cb; + $self->{next_timer} //= $self->timer(0 => \&_next); + return undef; +} + sub one_tick { my $self = shift; @@ -84,7 +91,7 @@ return !!delete $self->{io}{fileno $remove}; } -sub reset { delete @{shift()}{qw(io timers)} } +sub reset { delete @{shift()}{qw(io next_tick next_timer timers)} } sub start { my $self = shift; @@ -114,6 +121,12 @@ return $id; } +sub _next { + my $self = shift; + delete $self->{next_timer}; + while (my $cb = shift @{$self->{next_tick}}) { $self->$cb } +} + sub _timer { my ($self, $recurring, $after, $cb) = @_; @@ -208,6 +221,13 @@ Check if reactor is running. +=head2 next_tick + + my $undef = $reactor->next_tick(sub {...}); + +Invoke callback as soon as possible, but not before returning or other +callbacks that have been registered with this method, always returns C<undef>. + =head2 one_tick $reactor->one_tick; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Reactor.pm new/Mojolicious-6.10/lib/Mojo/Reactor.pm --- old/Mojolicious-6.08/lib/Mojo/Reactor.pm 2015-03-21 04:41:20.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojo/Reactor.pm 2015-04-27 02:48:49.000000000 +0200 @@ -13,17 +13,15 @@ sub io { croak 'Method "io" not implemented by subclass' } sub is_running { croak 'Method "is_running" not implemented by subclass' } - -sub next_tick { shift->timer(0 => @_) and return undef } - -sub one_tick { croak 'Method "one_tick" not implemented by subclass' } -sub recurring { croak 'Method "recurring" not implemented by subclass' } -sub remove { croak 'Method "remove" not implemented by subclass' } -sub reset { croak 'Method "reset" not implemented by subclass' } -sub start { croak 'Method "start" not implemented by subclass' } -sub stop { croak 'Method "stop" not implemented by subclass' } -sub timer { croak 'Method "timer" not implemented by subclass' } -sub watch { croak 'Method "watch" not implemented by subclass' } +sub next_tick { croak 'Method "next_tick" not implemented by subclass' } +sub one_tick { croak 'Method "one_tick" not implemented by subclass' } +sub recurring { croak 'Method "recurring" not implemented by subclass' } +sub remove { croak 'Method "remove" not implemented by subclass' } +sub reset { croak 'Method "reset" not implemented by subclass' } +sub start { croak 'Method "start" not implemented by subclass' } +sub stop { croak 'Method "stop" not implemented by subclass' } +sub timer { croak 'Method "timer" not implemented by subclass' } +sub watch { croak 'Method "watch" not implemented by subclass' } 1; @@ -41,6 +39,7 @@ sub again {...} sub io {...} sub is_running {...} + sub next_tick {...} sub one_tick {...} sub recurring {...} sub remove {...} @@ -122,8 +121,9 @@ my $undef = $reactor->next_tick(sub {...}); -Invoke callback as soon as possible, but not before returning, always returns -C<undef>. +Invoke callback as soon as possible, but not before returning or other +callbacks that have been registered with this method, always returns C<undef>. +Meant to be overloaded in a subclass. =head2 one_tick diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Server/Daemon.pm new/Mojolicious-6.10/lib/Mojo/Server/Daemon.pm --- old/Mojolicious-6.08/lib/Mojo/Server/Daemon.pm 2015-04-08 23:37:41.000000000 +0200 +++ new/Mojolicious-6.10/lib/Mojo/Server/Daemon.pm 2015-04-26 21:08:58.000000000 +0200 @@ -30,7 +30,7 @@ my $loop = $self->ioloop; my $int = $loop->recurring(1 => sub { }); local $SIG{INT} = local $SIG{TERM} = sub { $loop->stop }; - $self->start->setuidgid->ioloop->start; + $self->start->ioloop->start; $loop->remove($int); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Server/Hypnotoad.pm new/Mojolicious-6.10/lib/Mojo/Server/Hypnotoad.pm --- old/Mojolicious-6.08/lib/Mojo/Server/Hypnotoad.pm 2015-04-07 18:35:41.000000000 +0200 +++ new/Mojolicious-6.10/lib/Mojo/Server/Hypnotoad.pm 2015-04-26 21:11:07.000000000 +0200 @@ -27,9 +27,9 @@ $prefork->max_clients($c->{clients}) if $c->{clients}; $prefork->max_requests($c->{requests}) if $c->{requests}; defined $c->{$_} and $prefork->$_($c->{$_}) - for qw(accepts backlog graceful_timeout group heartbeat_interval), + for qw(accepts backlog graceful_timeout heartbeat_interval), qw(heartbeat_timeout inactivity_timeout listen multi_accept pid_file), - qw(user workers); + qw(workers); } sub run { @@ -272,13 +272,6 @@ being forced, defaults to the value of L<Mojo::Server::Prefork/"graceful_timeout">. -=head2 group - - group => 'staff' - -Group name for worker processes, defaults to the value of -L<Mojo::Server/"group">. - =head2 heartbeat_interval heartbeat_interval => 3 @@ -346,12 +339,6 @@ Maximum amount of time in seconds a zero downtime software upgrade may take before getting canceled, defaults to C<60>. -=head2 user - - user => 'sri' - -Username for worker processes, defaults to the value of L<Mojo::Server/"user">. - =head2 workers workers => 10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Server/Prefork.pm new/Mojolicious-6.10/lib/Mojo/Server/Prefork.pm --- old/Mojolicious-6.08/lib/Mojo/Server/Prefork.pm 2015-03-23 05:18:15.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojo/Server/Prefork.pm 2015-04-26 23:11:20.000000000 +0200 @@ -145,11 +145,8 @@ return $self->emit(spawn => $pid)->{pool}{$pid} = {time => steady_time} if $pid; - # Change user/group - $self->cleanup(0)->setuidgid; - # Heartbeat messages - my $loop = $self->ioloop; + my $loop = $self->cleanup(0)->ioloop; my $finished = 0; $loop->on(finish => sub { $finished = 1 }); weaken $self; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojo/Server.pm new/Mojolicious-6.10/lib/Mojo/Server.pm --- old/Mojolicious-6.08/lib/Mojo/Server.pm 2015-04-07 18:36:04.000000000 +0200 +++ new/Mojolicious-6.10/lib/Mojo/Server.pm 2015-04-26 21:08:42.000000000 +0200 @@ -8,8 +8,7 @@ use POSIX; use Scalar::Util 'blessed'; -has app => sub { shift->build_app('Mojo::HelloWorld') }; -has [qw(group user)]; +has app => sub { shift->build_app('Mojo::HelloWorld') }; has reverse_proxy => sub { $ENV{MOJO_REVERSE_PROXY} }; sub build_app { @@ -71,29 +70,6 @@ sub run { croak 'Method "run" not implemented by subclass' } -sub setuidgid { - my $self = shift; - - # Group (make sure secondary groups are reassigned too) - if (my $group = $self->group) { - $self->_error(qq{Group "$group" does not exist}) - unless defined(my $gid = getgrnam $group); - $self->_error(qq{Can't switch to group "$group": $!}) - unless ($( = $) = "$gid $gid") && $) eq "$gid $gid" && $( eq "$gid $gid"; - } - - # User - return $self unless my $user = $self->user; - $self->_error(qq{User "$user" does not exist}) - unless defined(my $uid = getpwnam $user); - $self->_error(qq{Can't switch to user "$user": $!}) - unless POSIX::setuid($uid); - - return $self; -} - -sub _error { $_[0]->app->log->error($_[1]) and croak $_[1] } - 1; =encoding utf8 @@ -158,13 +134,6 @@ Application this server handles, defaults to a L<Mojo::HelloWorld> object. -=head2 group - - my $group = $server->group; - $server = $server->group('users'); - -Group for server process. - =head2 reverse_proxy my $bool = $server->reverse_proxy; @@ -173,13 +142,6 @@ This server operates behind a reverse proxy, defaults to the value of the C<MOJO_REVERSE_PROXY> environment variable. -=head2 user - - my $user = $server->user; - $server = $server->user('web'); - -User for the server process. - =head1 METHODS L<Mojo::Server> inherits all methods from L<Mojo::EventEmitter> and implements @@ -226,12 +188,6 @@ Run server. Meant to be overloaded in a subclass. -=head2 setuidgid - - $server = $server->setuidgid; - -Set L</"user"> and L</"group"> for process. - =head1 SEE ALSO L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojolicious/Command/daemon.pm new/Mojolicious-6.10/lib/Mojolicious/Command/daemon.pm --- old/Mojolicious-6.08/lib/Mojolicious/Command/daemon.pm 2015-03-10 01:24:30.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojolicious/Command/daemon.pm 2015-04-26 21:12:40.000000000 +0200 @@ -14,12 +14,10 @@ GetOptionsFromArray \@args, 'b|backlog=i' => sub { $daemon->backlog($_[1]) }, 'c|clients=i' => sub { $daemon->max_clients($_[1]) }, - 'g|group=s' => sub { $daemon->group($_[1]) }, 'i|inactivity-timeout=i' => sub { $daemon->inactivity_timeout($_[1]) }, 'l|listen=s' => \my @listen, 'p|proxy' => sub { $daemon->reverse_proxy(1) }, - 'r|requests=i' => sub { $daemon->max_requests($_[1]) }, - 'u|user=s' => sub { $daemon->user($_[1]) }; + 'r|requests=i' => sub { $daemon->max_requests($_[1]) }; $daemon->listen(\@listen) if @listen; $daemon->run; @@ -47,7 +45,6 @@ SOMAXCONN -c, --clients <number> Maximum number of concurrent connections, defaults to 1000 - -g, --group <name> Group name for process -i, --inactivity-timeout <seconds> Inactivity timeout, defaults to the value of MOJO_INACTIVITY_TIMEOUT or 15 -l, --listen <location> One or more locations you want to @@ -58,7 +55,6 @@ MOJO_REVERSE_PROXY -r, --requests <number> Maximum number of requests per keep-alive connection, defaults to 25 - -u, --user <name> Username for process =head1 DESCRIPTION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojolicious/Command/prefork.pm new/Mojolicious-6.10/lib/Mojolicious/Command/prefork.pm --- old/Mojolicious-6.08/lib/Mojolicious/Command/prefork.pm 2015-02-25 06:11:43.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojolicious/Command/prefork.pm 2015-04-26 21:12:29.000000000 +0200 @@ -17,7 +17,6 @@ 'b|backlog=i' => sub { $prefork->backlog($_[1]) }, 'c|clients=i' => sub { $prefork->max_clients($_[1]) }, 'G|graceful-timeout=i' => sub { $prefork->graceful_timeout($_[1]) }, - 'g|group=s' => sub { $prefork->group($_[1]) }, 'I|heartbeat-interval=i' => sub { $prefork->heartbeat_interval($_[1]) }, 'H|heartbeat-timeout=i' => sub { $prefork->heartbeat_timeout($_[1]) }, 'i|inactivity-timeout=i' => sub { $prefork->inactivity_timeout($_[1]) }, @@ -26,7 +25,6 @@ 'P|pid-file=s' => sub { $prefork->pid_file($_[1]) }, 'p|proxy' => sub { $prefork->reverse_proxy(1) }, 'r|requests=i' => sub { $prefork->max_requests($_[1]) }, - 'u|user=s' => sub { $prefork->user($_[1]) }, 'w|workers=i' => sub { $prefork->workers($_[1]) }; $prefork->listen(\@listen) if @listen; @@ -58,7 +56,6 @@ -c, --clients <number> Maximum number of concurrent connections, defaults to 1000 -G, --graceful-timeout <seconds> Graceful timeout, defaults to 20. - -g, --group <name> Group name for process -I, --heartbeat-interval <seconds> Heartbeat interval, defaults to 5 -H, --heartbeat-timeout <seconds> Heartbeat timeout, defaults to 20 -i, --inactivity-timeout <seconds> Inactivity timeout, defaults to the @@ -75,7 +72,6 @@ MOJO_REVERSE_PROXY -r, --requests <number> Maximum number of requests per keep-alive connection, defaults to 25 - -u, --user <name> Username for process -w, --workers <number> Number of workers, defaults to 4 =head1 DESCRIPTION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojolicious/Guides/Cookbook.pod new/Mojolicious-6.10/lib/Mojolicious/Guides/Cookbook.pod --- old/Mojolicious-6.08/lib/Mojolicious/Guides/Cookbook.pod 2015-04-08 23:39:43.000000000 +0200 +++ new/Mojolicious-6.10/lib/Mojolicious/Guides/Cookbook.pod 2015-04-17 15:39:36.000000000 +0200 @@ -1351,7 +1351,8 @@ secr3t And to make your commands application specific, just add a custom namespace to -L<Mojolicious::Commands/"namespaces">. +L<Mojolicious::Commands/"namespaces"> and use a class name like +C<MyApp::Command::spy> instead of C<Mojolicious::Command::spy>. # Application package MyApp; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojolicious/Guides/Routing.pod new/Mojolicious-6.10/lib/Mojolicious/Guides/Routing.pod --- old/Mojolicious-6.08/lib/Mojolicious/Guides/Routing.pod 2015-04-08 23:42:05.000000000 +0200 +++ new/Mojolicious-6.10/lib/Mojolicious/Guides/Routing.pod 2015-04-25 06:33:02.000000000 +0200 @@ -421,9 +421,9 @@ # Generate URL "http://127.0.0.1:3000/foo/jan" for route "baz" my $url = $c->url_for('baz', user => 'jan')->to_abs; -Nameless routes get an automatically generated one assigned that is simply -equal to the route itself without non-word characters, custom names have a -higher precedence though. +You can assign a name with L<Mojolicious::Routes::Route/"name">, or let the +router generate one automatically, which would be equal to the route itself +without non-word characters, custom names have a higher precedence though. # /foo/bar ("foobar") $r->get('/foo/bar')->to('test#stuff'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojolicious/Types.pm new/Mojolicious-6.10/lib/Mojolicious/Types.pm --- old/Mojolicious-6.08/lib/Mojolicious/Types.pm 2015-02-25 04:23:39.000000000 +0100 +++ new/Mojolicious-6.10/lib/Mojolicious/Types.pm 2015-04-22 22:01:19.000000000 +0200 @@ -15,7 +15,7 @@ jpeg => ['image/jpeg'], jpg => ['image/jpeg'], js => ['application/javascript'], - json => ['application/json'], + json => ['application/json;charset=UTF-8'], mp3 => ['audio/mpeg'], mp4 => ['video/mp4'], ogg => ['audio/ogg'], @@ -92,7 +92,7 @@ jpeg -> image/jpeg jpg -> image/jpeg js -> application/javascript - json -> application/json + json -> application/json;charset=UTF-8 mp3 -> audio/mpeg mp4 -> video/mp4 ogg -> audio/ogg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/lib/Mojolicious.pm new/Mojolicious-6.10/lib/Mojolicious.pm --- old/Mojolicious-6.08/lib/Mojolicious.pm 2015-04-07 19:37:31.000000000 +0200 +++ new/Mojolicious-6.10/lib/Mojolicious.pm 2015-04-26 22:19:29.000000000 +0200 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Clinking Beer Mugs'; -our $VERSION = '6.08'; +our $VERSION = '6.10'; sub AUTOLOAD { my $self = shift; @@ -791,6 +791,8 @@ Andrey Khozov +Andrey Kuzmin + Andy Grundman Aristotle Pagaltzis @@ -961,6 +963,8 @@ Randal Schwartz +Richard Elberger + Rick Delaney Robert Hicks diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojo/cgi.t new/Mojolicious-6.10/t/mojo/cgi.t --- old/Mojolicious-6.08/t/mojo/cgi.t 2015-02-21 07:08:18.000000000 +0100 +++ new/Mojolicious-6.10/t/mojo/cgi.t 2015-04-22 22:02:43.000000000 +0200 @@ -157,7 +157,7 @@ $res = Mojo::Message::Response->new->parse("HTTP/1.1 200 OK\x0d\x0a$msg"); is $res->code, 200, 'right status'; is $res->headers->status, '200 OK', 'right "Status" value'; -is $res->headers->content_type, 'application/json', +is $res->headers->content_type, 'application/json;charset=UTF-8', 'right "Content-Type" value'; is $res->headers->content_length, 27, 'right "Content-Length" value'; is $res->json->{lalala}, 23, 'right value'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojo/hypnotoad.t new/Mojolicious-6.10/t/mojo/hypnotoad.t --- old/Mojolicious-6.08/t/mojo/hypnotoad.t 2015-03-10 01:59:12.000000000 +0100 +++ new/Mojolicious-6.10/t/mojo/hypnotoad.t 2015-04-26 21:11:28.000000000 +0200 @@ -24,7 +24,6 @@ backlog => 43, clients => 1, graceful_timeout => 23, - group => 'testers', heartbeat_interval => 7, heartbeat_timeout => 9, inactivity_timeout => 5, @@ -34,28 +33,25 @@ proxy => 1, requests => 3, upgrade_timeout => 45, - user => 'tester', workers => 7 }; is $hypnotoad->upgrade_timeout, 60, 'right default'; $hypnotoad->configure('test'); is_deeply $hypnotoad->prefork->listen, ['http://*:8080'], 'right value'; $hypnotoad->configure('myserver'); - is $hypnotoad->prefork->accepts, 13, 'right value'; - is $hypnotoad->prefork->backlog, 43, 'right value'; - is $hypnotoad->prefork->graceful_timeout, 23, 'right value'; - is $hypnotoad->prefork->group, 'testers', 'right value'; - is $hypnotoad->prefork->heartbeat_interval, 7, 'right value'; - is $hypnotoad->prefork->heartbeat_timeout, 9, 'right value'; - is $hypnotoad->prefork->inactivity_timeout, 5, 'right value'; + is $hypnotoad->prefork->accepts, 13, 'right value'; + is $hypnotoad->prefork->backlog, 43, 'right value'; + is $hypnotoad->prefork->graceful_timeout, 23, 'right value'; + is $hypnotoad->prefork->heartbeat_interval, 7, 'right value'; + is $hypnotoad->prefork->heartbeat_timeout, 9, 'right value'; + is $hypnotoad->prefork->inactivity_timeout, 5, 'right value'; is_deeply $hypnotoad->prefork->listen, ['http://*:8081'], 'right value'; is $hypnotoad->prefork->max_clients, 1, 'right value'; is $hypnotoad->prefork->max_requests, 3, 'right value'; is $hypnotoad->prefork->multi_accept, 16, 'right value'; is $hypnotoad->prefork->pid_file, '/foo/bar.pid', 'right value'; ok $hypnotoad->prefork->reverse_proxy, 'reverse proxy enabled'; - is $hypnotoad->prefork->user, 'tester', 'right value'; - is $hypnotoad->prefork->workers, 7, 'right value'; + is $hypnotoad->prefork->workers, 7, 'right value'; is $hypnotoad->upgrade_timeout, 45, 'right value'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojo/parameters.t new/Mojolicious-6.10/t/mojo/parameters.t --- old/Mojolicious-6.08/t/mojo/parameters.t 2015-02-23 21:18:43.000000000 +0100 +++ new/Mojolicious-6.10/t/mojo/parameters.t 2015-04-22 21:49:27.000000000 +0200 @@ -111,8 +111,8 @@ $params = Mojo::Parameters->new('foo=%2B'); is $params->param('foo'), '+', 'right value'; is_deeply $params->to_hash, {foo => '+'}, 'right structure'; -$params->param('foo ' => 'a'); -is $params->to_string, 'foo=%2B&foo+=a', 'right format'; +$params->param('foo ' => ' bar'); +is $params->to_string, 'foo=%2B&foo+=+bar', 'right format'; $params->remove('foo '); is_deeply $params->to_hash, {foo => '+'}, 'right structure'; $params->append('1 2', '3+3'); @@ -154,7 +154,7 @@ $params->parse('input=say%20%22%C2%AB~%22;'); is_deeply $params->pairs, ['input', 'say "«~";'], 'right structure'; is $params->param('input'), 'say "«~";', 'right value'; -is "$params", 'input=say+%22%C2%AB~%22%3B', 'right result'; +is "$params", 'input=say+%22%C2%AB%7E%22%3B', 'right result'; $params = Mojo::Parameters->new('♥=☃'); is_deeply $params->pairs, ['♥', '☃'], 'right structure'; is $params->param('♥'), '☃', 'right value'; @@ -175,8 +175,8 @@ is $params->to_string, 'a=2&b=3', 'right result'; # Query string -$params = Mojo::Parameters->new('%AZaz09-._~&;=+!$\'()*,%:@/?'); -is "$params", '%AZaz09-._~&;=+!$\'()*,%:@/?', 'right result'; +$params = Mojo::Parameters->new('AZaz09-._~%!$&\'()*+,;=:@/?'); +is "$params", 'AZaz09-._~%!$&\'()*+,;=:@/?', 'right result'; $params = Mojo::Parameters->new('foo{}bar'); is "$params", 'foo%7B%7Dbar', 'right result'; @@ -189,7 +189,8 @@ $params = Mojo::Parameters->new('!$\'()*,:@/foo?=!$\'()*,:@/?&bar=23'); is $params->param('!$\'()*,:@/foo?'), '!$\'()*,:@/?', 'right value'; is $params->param('bar'), 23, 'right value'; -is "$params", '!$\'()*,:@/foo?=!$\'()*,:@/?&bar=23', 'right result'; +is "$params", '%21%24%27%28%29*%2C%3A%40%2Ffoo%3F=' + . '%21%24%27%28%29*%2C%3A%40%2F%3F&bar=23', 'right result'; # No charset $params = Mojo::Parameters->new('%E5=%E4')->charset(undef); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojo/psgi.t new/Mojolicious-6.10/t/mojo/psgi.t --- old/Mojolicious-6.08/t/mojo/psgi.t 2015-02-25 21:36:51.000000000 +0100 +++ new/Mojolicious-6.10/t/mojo/psgi.t 2015-04-22 22:02:40.000000000 +0200 @@ -68,7 +68,8 @@ ok keys(%headers) >= 3, 'enough headers'; ok $headers{Date}, 'has "Date" value'; is $headers{'Content-Length'}, 43, 'right "Content-Length" value'; -is $headers{'Content-Type'}, 'application/json', 'right "Content-Type" value'; +is $headers{'Content-Type'}, 'application/json;charset=UTF-8', + 'right "Content-Type" value'; my $params = ''; while (defined(my $chunk = $res->[2]->getline)) { $params .= $chunk } is $ENV{MOJO_HELLO}, undef, 'finish event has not been emitted'; @@ -104,7 +105,8 @@ ok keys(%headers) >= 3, 'enough headers'; ok $headers{Date}, 'has "Date" value'; is $headers{'Content-Length'}, 43, 'right "Content-Length" value'; -is $headers{'Content-Type'}, 'application/json', 'right "Content-Type" value'; +is $headers{'Content-Type'}, 'application/json;charset=UTF-8', + 'right "Content-Type" value'; $params = ''; while (defined(my $chunk = $res->[2]->getline)) { $params .= $chunk } is $ENV{MOJO_HELLO}, undef, 'finish event has not been emitted'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojo/reactor_ev.t new/Mojolicious-6.10/t/mojo/reactor_ev.t --- old/Mojolicious-6.08/t/mojo/reactor_ev.t 2015-03-20 20:09:08.000000000 +0100 +++ new/Mojolicious-6.10/t/mojo/reactor_ev.t 2015-04-27 03:06:46.000000000 +0200 @@ -138,9 +138,10 @@ ok $recurring, 'recurring was triggered again'; # Reset +$reactor->next_tick(sub { die 'Reset failed' }); $reactor->reset; ($readable, $writable, $recurring) = (); -$reactor->timer(0.025 => sub { shift->stop }); +$reactor->next_tick(sub { shift->stop }); $reactor->start; ok !$readable, 'io event was not triggered again'; ok !$writable, 'io event was not triggered again'; @@ -148,6 +149,14 @@ my $reactor2 = Mojo::Reactor::EV->new; is ref $reactor2, 'Mojo::Reactor::Poll', 'right object'; +# Ordered next_tick +my $result = []; +for my $i (1 .. 10) { + $reactor->next_tick(sub { push @$result, $i }); +} +$reactor->start; +is_deeply $result, [1 .. 10], 'right result'; + # Reset while watchers are active $writable = undef; $reactor->io($_ => sub { ++$writable and shift->reset })->watch($_, 0, 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojo/reactor_poll.t new/Mojolicious-6.10/t/mojo/reactor_poll.t --- old/Mojolicious-6.08/t/mojo/reactor_poll.t 2015-03-20 20:09:12.000000000 +0100 +++ new/Mojolicious-6.10/t/mojo/reactor_poll.t 2015-04-27 03:07:04.000000000 +0200 @@ -135,9 +135,10 @@ ok $recurring, 'recurring was triggered again'; # Reset +$reactor->next_tick(sub { die 'Reset failed' }); $reactor->reset; ($readable, $writable, $recurring) = (); -$reactor->timer(0.025 => sub { shift->stop }); +$reactor->next_tick(sub { shift->stop }); $reactor->start; ok !$readable, 'io event was not triggered again'; ok !$writable, 'io event was not triggered again'; @@ -145,6 +146,14 @@ my $reactor2 = Mojo::Reactor::Poll->new; is ref $reactor2, 'Mojo::Reactor::Poll', 'right object'; +# Ordered next_tick +my $result = []; +for my $i (1 .. 10) { + $reactor->next_tick(sub { push @$result, $i }); +} +$reactor->start; +is_deeply $result, [1 .. 10], 'right result'; + # Reset while watchers are active $writable = undef; $reactor->io($_ => sub { ++$writable and shift->reset })->watch($_, 0, 1) @@ -288,6 +297,8 @@ like $@, qr/Method "io" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->is_running }; like $@, qr/Method "is_running" not implemented by subclass/, 'right error'; +eval { Mojo::Reactor->next_tick }; +like $@, qr/Method "next_tick" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->one_tick }; like $@, qr/Method "one_tick" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->recurring }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojolicious/charset_lite_app.t new/Mojolicious-6.10/t/mojolicious/charset_lite_app.t --- old/Mojolicious-6.08/t/mojolicious/charset_lite_app.t 2015-02-23 18:30:38.000000000 +0100 +++ new/Mojolicious-6.10/t/mojolicious/charset_lite_app.t 2015-04-22 22:02:36.000000000 +0200 @@ -90,12 +90,14 @@ $t->post_ok('/data', $yatta_sjis)->status_is(200)->content_is($yatta_sjis); # JSON data -$t->get_ok('/json')->status_is(200)->content_type_is('application/json') +$t->get_ok('/json')->status_is(200) + ->content_type_is('application/json;charset=UTF-8') ->json_is({test => $yatta}); # IRI $t->get_ok('/привет/мир')->status_is(200) - ->content_type_is('application/json')->json_is({foo => $yatta}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({foo => $yatta}); # Shift_JIS parameters my $url diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojolicious/group_lite_app.t new/Mojolicious-6.10/t/mojolicious/group_lite_app.t --- old/Mojolicious-6.08/t/mojolicious/group_lite_app.t 2015-02-25 21:37:58.000000000 +0100 +++ new/Mojolicious-6.10/t/mojolicious/group_lite_app.t 2015-04-22 22:02:32.000000000 +0200 @@ -430,7 +430,8 @@ # Format "json" has been detected $t->get_ok('/some_formats.json')->status_is(200) - ->content_type_is('application/json')->content_is('Some format detection.'); + ->content_type_is('application/json;charset=UTF-8') + ->content_is('Some format detection.'); # Invalid format $t->get_ok('/some_formats.xml')->status_is(404) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojolicious/lite_app.t new/Mojolicious-6.10/t/mojolicious/lite_app.t --- old/Mojolicious-6.08/t/mojolicious/lite_app.t 2015-03-24 19:16:25.000000000 +0100 +++ new/Mojolicious-6.10/t/mojolicious/lite_app.t 2015-04-22 22:02:23.000000000 +0200 @@ -878,7 +878,8 @@ # JSON (with a lot of different tests) $t->get_ok('/json')->status_is(200)->header_is(Server => 'Mojolicious (Perl)') - ->content_type_is('application/json')->json_is({foo => [1, -2, 3, 'b☃r']}) + ->content_type_is('application/json;charset=UTF-8') + ->json_is({foo => [1, -2, 3, 'b☃r']}) ->json_is('/foo' => [1, -2, 3, 'b☃r']) ->json_is('/foo/3', 'b☃r', 'with description')->json_has('/foo') ->json_has('/foo', 'with description')->json_hasnt('/bar') @@ -890,7 +891,8 @@ # JSON ("null") $t->get_ok('/json' => json => undef)->status_is(200) ->header_is(Server => 'Mojolicious (Perl)') - ->content_type_is('application/json')->json_is(undef)->content_is('null'); + ->content_type_is('application/json;charset=UTF-8')->json_is(undef) + ->content_is('null'); # Stash values in template $t->get_ok('/autostash?bar=23')->status_is(200) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojolicious/restful_lite_app.t new/Mojolicious-6.10/t/mojolicious/restful_lite_app.t --- old/Mojolicious-6.08/t/mojolicious/restful_lite_app.t 2015-02-21 07:08:18.000000000 +0100 +++ new/Mojolicious-6.10/t/mojolicious/restful_lite_app.t 2015-04-22 22:02:20.000000000 +0200 @@ -51,20 +51,21 @@ # Hash with "json" format $t->post_ok( '/json/echo' => {Accept => 'application/json'} => json => {hello => 'world'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({hello => 'world'}); my $tx = $t->ua->build_tx( PUT => '/json/echo' => {Accept => 'application/json'} => json => {hello => 'world'}); -$t->request_ok($tx)->status_is(200)->content_type_is('application/json') +$t->request_ok($tx)->status_is(200) + ->content_type_is('application/json;charset=UTF-8') ->json_is({hello => 'world'}); # Array with "json" format $tx = $t->ua->build_tx( PUT => '/json/echo' => {Accept => 'application/json'} => json => [1, 2, 3]); -$t->request_ok($tx)->status_is(200)->content_type_is('application/json') - ->json_is([1, 2, 3]); +$t->request_ok($tx)->status_is(200) + ->content_type_is('application/json;charset=UTF-8')->json_is([1, 2, 3]); # Nothing $t->get_ok('/accepts')->status_is(200)->json_is({best => 'html'}); @@ -158,45 +159,53 @@ ->text_is('html > body', 'works'); # "json" format -$t->get_ok('/rest.json')->status_is(200)->content_type_is('application/json') +$t->get_ok('/rest.json')->status_is(200) + ->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works'}); # Accept "json" $t->get_ok('/rest' => {Accept => 'application/json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works'}); # Accept "json" again $t->get_ok('/rest' => {Accept => 'APPLICATION/JSON'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works'}); # Accept "json" with format $t->get_ok('/rest.json' => {Accept => 'application/json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works'}); # Accept "json" with wrong format $t->get_ok('/rest.png' => {Accept => 'application/json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works'}); # Accept "json" with quality $t->get_ok('/rest' => {Accept => 'application/json;q=9'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works'}); # "json" query $t->get_ok('/rest?format=json')->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works'}); # "json" format with query $t->get_ok('/rest.json?format=json')->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works'}); # Accept "json" with query $t->get_ok('/rest?format=json' => {Accept => 'application/json'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works'}); # Accept "json" with everything $t->get_ok('/rest.json?format=json' => {Accept => 'application/json'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works'}); # "xml" format @@ -321,65 +330,75 @@ ->text_is('html > body', 'works too'); # "json" format -$t->post_ok('/rest.json')->status_is(200)->content_type_is('application/json') +$t->post_ok('/rest.json')->status_is(200) + ->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works too'}); # Accept "json" $t->post_ok('/rest' => {Accept => 'application/json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # Accept "json" again $t->post_ok('/rest' => {Accept => 'APPLICATION/JSON'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # Accept "json" with format $t->post_ok('/rest.json' => {Accept => 'application/json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # Accept "json" with wrong format $t->post_ok('/rest.png' => {Accept => 'application/json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # Accept "json" with quality $t->post_ok('/rest' => {Accept => 'application/json;q=9'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # "json" query $t->post_ok('/rest?format=json')->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # "json" format with query $t->post_ok('/rest.json?format=json')->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # Accept "json" with query $t->post_ok('/rest?format=json' => {Accept => 'application/json'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works too'}); # Accept "json" with everything $t->post_ok('/rest.json?format=json' => {Accept => 'application/json'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works too'}); # "json" form $t->post_ok('/rest' => form => {format => 'json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # "json" format with form $t->post_ok('/rest.json' => form => {format => 'json'})->status_is(200) - ->content_type_is('application/json')->json_is({just => 'works too'}); + ->content_type_is('application/json;charset=UTF-8') + ->json_is({just => 'works too'}); # Accept "json" with form $t->post_ok( '/rest' => {Accept => 'application/json'} => form => {format => 'json'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works too'}); # Accept "json" with everything, form alternative $t->post_ok( '/rest.json' => {Accept => 'application/json'} => form => {format => 'json'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works too'}); # "xml" format @@ -500,7 +519,7 @@ my $jquery = 'application/json, text/javascript, */*; q=0.01'; $t->get_ok( '/rest' => {Accept => $jquery, 'X-Requested-With' => 'XMLHttpRequest'}) - ->status_is(200)->content_type_is('application/json') + ->status_is(200)->content_type_is('application/json;charset=UTF-8') ->json_is({just => 'works'}); done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.08/t/mojolicious/types.t new/Mojolicious-6.10/t/mojolicious/types.t --- old/Mojolicious-6.08/t/mojolicious/types.t 2015-02-25 04:25:02.000000000 +0100 +++ new/Mojolicious-6.10/t/mojolicious/types.t 2015-04-22 22:02:17.000000000 +0200 @@ -5,7 +5,7 @@ # Basic functionality my $t = Mojolicious::Types->new; -is $t->type('json'), 'application/json', 'right type'; +is $t->type('json'), 'application/json;charset=UTF-8', 'right type'; is $t->type('foo'), undef, 'no type'; $t->type(foo => 'foo/bar'); is $t->type('foo'), 'foo/bar', 'right type'; ++++++ cpanspec.yml ++++++ --- #description_paragraphs: 3 #no_testing: broken upstream #sources: # - source1 # - source2 #patches: # foo.patch: -p1 # bar.patch: #preamble: |- # BuildRequires: gcc-c++ #post_prep: |- # hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` # sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL #post_install: |- # sed on %{name}.files #license: SUSE-NonFree #skip_noarch: 1 #custom_build: |- #./Build build flags=%{?_smp_mflags} --myflag #custom_test: |- #startserver && make test #ignore_requires: Bizarre::Module