Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-Mojolicious for
openSUSE:Factory checked in at 2021-02-17 18:12:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious"
Wed Feb 17 18:12:42 2021 rev:155 rq:873064 version:9.01
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes
2021-02-16 22:49:41.950615470 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Mojolicious.new.28504/perl-Mojolicious.changes
2021-02-17 18:13:30.646037342 +0100
@@ -1,0 +2,11 @@
+Wed Feb 17 03:11:22 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 9.01
+ see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+ 9.01 2021-02-16
+ - Added EXPERIMENTAL color attribute to Mojo::Log.
+ - Added EXPERIMENTAL MOJO_LOG_COLOR environment variable to Mojo::Log.
+ - Fixed Windows support of network_contains function in Mojo::Util.
(jberger)
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-9.0.tar.gz
New:
----
Mojolicious-9.01.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious.spec ++++++
--- /var/tmp/diff_new_pack.oHqHjd/_old 2021-02-17 18:13:31.194037790 +0100
+++ /var/tmp/diff_new_pack.oHqHjd/_new 2021-02-17 18:13:31.198037793 +0100
@@ -18,7 +18,7 @@
%define cpan_name Mojolicious
Name: perl-Mojolicious
-Version: 9.0
+Version: 9.01
Release: 0
Summary: Real-time web framework
License: Artistic-2.0
++++++ Mojolicious-9.0.tar.gz -> Mojolicious-9.01.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/Changes new/Mojolicious-9.01/Changes
--- old/Mojolicious-9.0/Changes 2021-02-12 19:33:06.000000000 +0100
+++ new/Mojolicious-9.01/Changes 2021-02-16 21:38:48.000000000 +0100
@@ -1,4 +1,9 @@
+9.01 2021-02-16
+ - Added EXPERIMENTAL color attribute to Mojo::Log.
+ - Added EXPERIMENTAL MOJO_LOG_COLOR environment variable to Mojo::Log.
+ - Fixed Windows support of network_contains function in Mojo::Util. (jberger)
+
9.0 2021-02-14
- Code name "Waffle", this is a major release.
- Added support for deployment specific plugins.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/META.json
new/Mojolicious-9.01/META.json
--- old/Mojolicious-9.0/META.json 2021-02-14 19:43:01.000000000 +0100
+++ new/Mojolicious-9.01/META.json 2021-02-16 22:31:49.000000000 +0100
@@ -63,6 +63,6 @@
"web" : "https://webchat.freenode.net/#mojo"
}
},
- "version" : "9.0",
+ "version" : "9.01",
"x_serialization_backend" : "JSON::PP version 4.06"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/META.yml
new/Mojolicious-9.01/META.yml
--- old/Mojolicious-9.0/META.yml 2021-02-14 19:43:01.000000000 +0100
+++ new/Mojolicious-9.01/META.yml 2021-02-16 22:31:49.000000000 +0100
@@ -34,5 +34,5 @@
homepage: https://mojolicious.org
license: http://www.opensource.org/licenses/artistic-license-2.0
repository: https://github.com/mojolicious/mojo.git
-version: '9.0'
+version: '9.01'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojo/Content/MultiPart.pm
new/Mojolicious-9.01/lib/Mojo/Content/MultiPart.pm
--- old/Mojolicious-9.0/lib/Mojo/Content/MultiPart.pm 2021-01-29
18:08:08.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojo/Content/MultiPart.pm 2021-02-16
20:58:37.000000000 +0100
@@ -207,7 +207,7 @@
=head1 EVENTS
-L<Mojo::Content::Multipart> inherits all events from L<Mojo::Content> and can
emit the following new ones.
+L<Mojo::Content::MultiPart> inherits all events from L<Mojo::Content> and can
emit the following new ones.
=head2 part
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojo/Log.pm
new/Mojolicious-9.01/lib/Mojo/Log.pm
--- old/Mojolicious-9.0/lib/Mojo/Log.pm 2021-02-12 19:32:41.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojo/Log.pm 2021-02-16 20:58:37.000000000
+0100
@@ -5,9 +5,11 @@
use Fcntl qw(:flock);
use Mojo::File;
use Mojo::Util qw(encode);
+use Term::ANSIColor qw(colored);
use Time::HiRes qw(time);
-has format => sub { shift->short ? \&_short : \&_default };
+has color => sub { $ENV{MOJO_LOG_COLOR} };
+has format => sub { $_[0]->short ? \&_short : $_[0]->color ? \&_color :
\&_default };
has handle => sub {
# STDERR
@@ -28,6 +30,9 @@
# Systemd magic numbers
my %MAGIC = (debug => 7, info => 6, warn => 4, error => 3, fatal => 2);
+# Colors
+my %COLORS = (warn => ['yellow'], error => ['red'], fatal => ['white on_red']);
+
sub append {
my ($self, $msg) = @_;
@@ -58,6 +63,11 @@
sub warn { 3 >= $LEVEL{$_[0]->level} ? _log(@_, 'warn') : $_[0] }
+sub _color {
+ my $msg = _default(shift, my $level = shift, @_);
+ return $COLORS{$level} ? colored($COLORS{$level}, $msg) : $msg;
+}
+
sub _default {
my ($time, $level) = (shift, shift);
my ($s, $m, $h, $day, $month, $year) = localtime $time;
@@ -135,6 +145,15 @@
L<Mojo::Log> implements the following attributes.
+=head2 color
+
+ my $bool = $log->color;
+ $log = $log->color($bool);
+
+Colorize log messages with the levels C<warn>, C<error> and C<fatal> using
L<Term::ANSIColor>, defaults to the value of
+the C<MOJO_LOG_COLOR> environment variables. Note that this attribute is
B<EXPERIMENTAL> and might change without
+warning!
+
=head2 format
my $cb = $log->format;
@@ -185,8 +204,8 @@
my $bool = $log->short;
$log = $log->short($bool);
-Generate short log messages without a timestamp, suitable for systemd,
defaults to the value of the C<MOJO_LOG_SHORT>
-environment variables.
+Generate short log messages without a timestamp but with journald log level
prefix, suitable for systemd environments,
+defaults to the value of the C<MOJO_LOG_SHORT> environment variables.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojo/Message/Request.pm
new/Mojolicious-9.01/lib/Mojo/Message/Request.pm
--- old/Mojolicious-9.0/lib/Mojo/Message/Request.pm 2021-01-29
18:08:08.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojo/Message/Request.pm 2021-02-16
21:25:51.000000000 +0100
@@ -305,7 +305,7 @@
=head2 trusted_proxies
my $proxies = $req->trusted_proxies;
- $req = $req->trusted_proxies(['10.0/8', '127.0.0.1', '172.16.0/12',
'192.168.0/16', 'fc00::/7']);
+ $req = $req->trusted_proxies(['10.0.0.0/8', '127.0.0.1',
'172.16.0.0.0/12', '192.168.0.0/16', 'fc00::/7']);
Trusted reverse proxies, addresses or networks in CIDR form.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojo/Server/Hypnotoad.pm
new/Mojolicious-9.01/lib/Mojo/Server/Hypnotoad.pm
--- old/Mojolicious-9.0/lib/Mojo/Server/Hypnotoad.pm 2021-02-04
18:55:52.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojo/Server/Hypnotoad.pm 2021-02-16
21:25:51.000000000 +0100
@@ -334,7 +334,7 @@
=head2 trusted_proxies
- trusted_proxies => ['10.0/8', '127.0.0.1', '172.16.0/12', '192.168.0/16',
'fc00::/7']
+ trusted_proxies => ['10.0.0.0/8', '127.0.0.1', '172.16.0.0/12',
'192.168.0.0/16', 'fc00::/7']
Trusted reverse proxies, addresses or networks in CIDR form.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-9.0/lib/Mojo/Server/Morbo/Backend/Poll.pm
new/Mojolicious-9.01/lib/Mojo/Server/Morbo/Backend/Poll.pm
--- old/Mojolicious-9.0/lib/Mojo/Server/Morbo/Backend/Poll.pm 2021-01-29
18:08:08.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojo/Server/Morbo/Backend/Poll.pm 2021-02-16
20:58:37.000000000 +0100
@@ -42,7 +42,7 @@
=head1 DESCRIPTION
-L<Mojo::Server::Morbo::Backend:Poll> is the default backend for
L<Mojo::Server::Morbo>.
+L<Mojo::Server::Morbo::Backend::Poll> is the default backend for
L<Mojo::Server::Morbo>.
=head1 ATTRIBUTES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojo/Server.pm
new/Mojolicious-9.01/lib/Mojo/Server.pm
--- old/Mojolicious-9.0/lib/Mojo/Server.pm 2021-01-29 18:08:08.000000000
+0100
+++ new/Mojolicious-9.01/lib/Mojo/Server.pm 2021-02-16 21:25:51.000000000
+0100
@@ -138,7 +138,7 @@
=head2 trusted_proxies
my $proxies = $server->trusted_proxies;
- $server = $server->trusted_proxies(['10.0/8', '127.0.0.1',
'172.16.0/12', '192.168.0/16', 'fc00::/7']);
+ $server = $server->trusted_proxies(['10.0.0.0/8', '127.0.0.1',
'172.16.0.0/12', '192.168.0.0/16', 'fc00::/7']);
This server expects requests from trusted reverse proxies, defaults to the
value of the C<MOJO_TRUSTED_PROXIES>
environment variable split on commas with optional whitespace. These proxies
should be addresses or networks in CIDR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojo/Util.pm
new/Mojolicious-9.01/lib/Mojo/Util.pm
--- old/Mojolicious-9.0/lib/Mojo/Util.pm 2021-02-05 13:25:46.000000000
+0100
+++ new/Mojolicious-9.01/lib/Mojo/Util.pm 2021-02-16 21:25:51.000000000
+0100
@@ -15,7 +15,7 @@
use List::Util qw(min);
use MIME::Base64 qw(decode_base64 encode_base64);
use Pod::Usage qw(pod2usage);
-use Socket qw(inet_aton inet_pton AF_INET6);
+use Socket qw(inet_pton AF_INET6 AF_INET);
use Sub::Util qw(set_subname);
use Symbol qw(delete_package);
use Time::HiRes ();
@@ -194,8 +194,8 @@
return undef if $v6 xor $addr =~ /:/;
# Convert addresses to binary
- return undef unless $net = $v6 ? inet_pton(AF_INET6, $net) :
inet_aton($net);
- return undef unless $addr = $v6 ? inet_pton(AF_INET6, $addr) :
inet_aton($addr);
+ return undef unless $net = inet_pton($v6 ? AF_INET6 : AF_INET, $net);
+ return undef unless $addr = inet_pton($v6 ? AF_INET6 : AF_INET, $addr);
my $length = $v6 ? 128 : 32;
# Apply mask if given
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojolicious/Command/daemon.pm
new/Mojolicious-9.01/lib/Mojolicious/Command/daemon.pm
--- old/Mojolicious-9.0/lib/Mojolicious/Command/daemon.pm 2021-01-29
18:08:08.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojolicious/Command/daemon.pm 2021-02-16
21:25:51.000000000 +0100
@@ -47,7 +47,7 @@
./myapp.pl daemon -l http://127.0.0.1:8080 -l https://[::]:8081
./myapp.pl daemon -l 'https://*:443?cert=./server.crt&key=./server.key'
./myapp.pl daemon -l http+unix://%2Ftmp%2Fmyapp.sock
- ./myapp.pl daemon -l http://127.0.0.1:8080 -p 127.0/8 -p fc00::/7
+ ./myapp.pl daemon -l http://127.0.0.1:8080 -p 127.0.0.0/8 -p fc00::/7
Options:
-b, --backlog <size> Listen backlog size, defaults to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojolicious/Command/prefork.pm
new/Mojolicious-9.01/lib/Mojolicious/Command/prefork.pm
--- old/Mojolicious-9.0/lib/Mojolicious/Command/prefork.pm 2021-01-29
18:08:08.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojolicious/Command/prefork.pm 2021-02-16
21:25:51.000000000 +0100
@@ -54,7 +54,7 @@
./myapp.pl prefork -l http://127.0.0.1:8080 -l https://[::]:8081
./myapp.pl prefork -l 'https://*:443?cert=./server.crt&key=./server.key'
./myapp.pl prefork -l http+unix://%2Ftmp%2Fmyapp.sock -w 12
- ./myapp.pl prefork -l http://127.0.0.1:8080 -p 127.0/8 -p fc00::/7
+ ./myapp.pl prefork -l http://127.0.0.1:8080 -p 127.0.0.0/8 -p fc00::/7
Options:
-a, --accepts <number> Number of connections for workers to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojolicious/Guides/Cookbook.pod
new/Mojolicious-9.01/lib/Mojolicious/Guides/Cookbook.pod
--- old/Mojolicious-9.0/lib/Mojolicious/Guides/Cookbook.pod 2021-02-12
19:32:41.000000000 +0100
+++ new/Mojolicious-9.01/lib/Mojolicious/Guides/Cookbook.pod 2021-02-16
20:58:37.000000000 +0100
@@ -255,8 +255,8 @@
It uses the latest L<Perl container|https://hub.docker.com/_/perl> from Docker
Hub, copies all the contents of your
application directory into the container, installs CPAN dependencies with
L<App::cpanminus>, and then starts the
-application on port C<3000> with the pre-forking web server. With
L<Mojolicious::Command::generate::dockerfile> there is
-also a helper command to generate a minimal C<Dockerfile> for you.
+application on port C<3000> with the pre-forking web server. With
L<Mojolicious::Command::Author::generate::dockerfile>
+there is also a helper command to generate a minimal C<Dockerfile> for you.
$ ./myapp.pl generate dockerfile
...
@@ -545,7 +545,7 @@
Deployment specific 3rd party plugins such as
L<Mojolicious::Plugin::SetUserGroup> do not need to be included in your
application code. They can also be loaded later on via the reserved C<plugins>
value for L<Mojolicious> applications
-that are using any one of the built-in configuration plugins
L<Mojolicious::Plguin::Config>,
+that are using any one of the built-in configuration plugins
L<Mojolicious::Plugin::Config>,
L<Mojolicious::Plugin::JSONConfig> or L<Mojolicious::Plugin::NotYAMLConfig>.
# myapp.conf
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/lib/Mojolicious.pm
new/Mojolicious-9.01/lib/Mojolicious.pm
--- old/Mojolicious-9.0/lib/Mojolicious.pm 2021-02-12 19:32:41.000000000
+0100
+++ new/Mojolicious-9.01/lib/Mojolicious.pm 2021-02-16 20:58:37.000000000
+0100
@@ -55,7 +55,7 @@
has validator => sub { Mojolicious::Validator->new };
our $CODENAME = 'Waffle';
-our $VERSION = '9.0';
+our $VERSION = '9.01';
sub BUILD_DYNAMIC {
my ($class, $method, $dyn_methods) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/t/mojo/cgi.t
new/Mojolicious-9.01/t/mojo/cgi.t
--- old/Mojolicious-9.0/t/mojo/cgi.t 2021-01-27 16:04:39.000000000 +0100
+++ new/Mojolicious-9.01/t/mojo/cgi.t 2021-02-16 21:25:51.000000000 +0100
@@ -193,7 +193,7 @@
HTTP_X_FORWARDED_FOR => '10.10.10.10, 192.0.2.2, 192.0.2.1',
HTTP_X_FORWARDED_PROTO => 'https'
);
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8, 192.0/8';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8, 192.0.0.0/8';
is(Mojolicious::Command::cgi->new(app => app)->run, 200, 'right status');
my $res = Mojo::Message::Response->new->parse("HTTP/1.1 200 OK\x0d\x0a$msg");
@@ -217,7 +217,7 @@
HTTP_X_FORWARDED_FOR => '10.10.10.10, 192.0.2.2, 192.0.2.1',
HTTP_X_FORWARDED_PROTO => 'https'
);
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8, 192.0/8';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8, 192.0.0.0/8';
is(Mojolicious::Command::cgi->new(app => app)->run, 200, 'right status');
my $res = Mojo::Message::Response->new->parse("HTTP/1.1 200 OK\x0d\x0a$msg");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/t/mojo/hypnotoad.t
new/Mojolicious-9.01/t/mojo/hypnotoad.t
--- old/Mojolicious-9.0/t/mojo/hypnotoad.t 2021-01-27 16:04:38.000000000
+0100
+++ new/Mojolicious-9.01/t/mojo/hypnotoad.t 2021-02-16 21:25:51.000000000
+0100
@@ -30,7 +30,7 @@
proxy => 1,
requests => 3,
spare => 4,
- trusted_proxies => ['127.0/8'],
+ trusted_proxies => ['127.0.0.0/8'],
upgrade_timeout => 45,
workers => 7
};
@@ -51,7 +51,7 @@
is $hypnotoad->prefork->pid_file, '/foo/bar.pid', 'right
value';
ok $hypnotoad->prefork->reverse_proxy, 'reverse proxy enabled';
is $hypnotoad->prefork->spare, 4, 'right value';
- is_deeply $hypnotoad->prefork->trusted_proxies, ['127.0/8'], 'right value';
+ is_deeply $hypnotoad->prefork->trusted_proxies, ['127.0.0.0/8'], '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-9.0/t/mojo/log.t
new/Mojolicious-9.01/t/mojo/log.t
--- old/Mojolicious-9.0/t/mojo/log.t 2021-02-12 19:32:41.000000000 +0100
+++ new/Mojolicious-9.01/t/mojo/log.t 2021-02-16 20:58:37.000000000 +0100
@@ -74,6 +74,26 @@
like $log->format->(time, 'debug', 'Test', '1', '2', '3'), qr/^<7>\[\d+\]
\[d\] Test 1 2 3\n$/, 'right format';
};
+subtest 'Colorized log messages' => sub {
+ my $log = Mojo::Log->new;
+ ok !$log->color, 'plain messages';
+ like $log->format->(time, 'debug', 'Test 123'), qr/^\[.*\] \[debug\] Test
123\n$/, 'right format';
+ local $ENV{MOJO_LOG_COLOR} = 1;
+ $log = Mojo::Log->new;
+ ok $log->color, 'colored messages';
+ $log = Mojo::Log->new(color => 1);
+ ok $log->color, 'colored messages';
+ like $log->format->(time, 'debug', 'Test 123'), qr/^\[.+\] \[\d+\] \[debug\]
Test 123\n$/, 'right format';
+ like $log->format->(time, 'info', 'Test 123'), qr/^\[.+\] \[\d+\] \[info\]
Test 123\n$/, 'right format';
+ like $log->format->(time, 'warn', 'Test 123'), qr/^\e\[33m\[.+\] \[\d+\]
\[warn\] Test 123\n\e\[0m$/, 'right format';
+ like $log->format->(time, 'error', 'Test 123'), qr/^\e\[31m\[.+\] \[\d+\]
\[error\] Test 123\n\e\[0m$/,
+ 'right format';
+ like $log->format->(time, 'fatal', 'Test 123'), qr/^\e\[37;41m\[.+\] \[\d+\]
\[fatal\] Test 123\n\e\[0m$/,
+ 'right format';
+ like $log->format->(1613484767, 'error', 'Test', '1', '2', '3'),
+ qr/^\e\[31m\[.+\] \[\d+\] \[error\] Test 1 2 3\n\e\[0m$/, 'right format';
+};
+
subtest 'Events' => sub {
my $log = Mojo::Log->new;
my $msgs = [];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/t/mojo/psgi.t
new/Mojolicious-9.01/t/mojo/psgi.t
--- old/Mojolicious-9.0/t/mojo/psgi.t 2021-01-27 16:04:34.000000000 +0100
+++ new/Mojolicious-9.01/t/mojo/psgi.t 2021-02-16 21:25:51.000000000 +0100
@@ -262,7 +262,7 @@
};
my ($app, $res);
{
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8, 192.0/8';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8, 192.0.0.0/8';
$app = Mojolicious::Command::psgi->new(app => app)->run;
$res = $app->($env);
}
@@ -298,7 +298,7 @@
};
my ($app, $res);
{
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8, 192.0/8';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8, 192.0.0.0/8';
$app = Mojolicious::Command::psgi->new(app => app)->run;
$res = $app->($env);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/t/mojo/util.t
new/Mojolicious-9.01/t/mojo/util.t
--- old/Mojolicious-9.0/t/mojo/util.t 2021-01-27 16:04:36.000000000 +0100
+++ new/Mojolicious-9.01/t/mojo/util.t 2021-02-16 21:25:51.000000000 +0100
@@ -480,7 +480,7 @@
};
subtest 'network_contains' => sub {
- ok !network_contains('10.0/8', ''), 'empty address';
+ ok !network_contains('10.0.0.0/8', ''), 'empty address';
ok !network_contains('', '10.10.10.10'), 'empty network';
ok !network_contains('foo', '10.10.10.10'), 'invalid v4 network';
ok !network_contains('10.10.10.10', 'foo'), 'invalid v4 address';
@@ -492,8 +492,8 @@
ok network_contains('192.168.0.1/33', '192.168.0.1'), 'oversize v4 mask';
ok network_contains('::/130', '::'), 'oversize v6 mask';
- ok network_contains('0/0', '0'), 'v4 network
contains addresss';
- ok network_contains('0/0', '255.255.255.255'), 'v4 network
contains addresss';
+ ok network_contains('0.0.0.0/0', '0.0.0.0'), 'v4 network
contains addresss';
+ ok network_contains('0.0.0.0/0', '255.255.255.255'), 'v4 network
contains addresss';
ok network_contains('192.168.0.0/24', '192.168.0.1'), 'v4 network
contains addresss';
ok network_contains('10.10.10.8/30', '10.10.10.11'), 'v4 network
contains addresss';
ok network_contains('10.10.10.8/30', '10.10.10.8'), 'v4 network
contains addresss';
@@ -503,7 +503,7 @@
ok network_contains('10.10.10.8/29', '10.10.10.10'), 'v4 network
contains addresss';
ok network_contains('127.0.0.1', '127.0.0.1'), 'v4 network
contains addresss';
- ok !network_contains('0/32', '1'), 'v4 network does
not contain address';
+ ok !network_contains('0.0.0.0/32', '0.0.0.1'), 'v4 network does
not contain address';
ok !network_contains('192.168.1.0/24', '192.168.0.1'), 'v4 network does
not contain address';
ok !network_contains('10.10.0.8/29', '10.10.10.8'), 'v4 network does
not contain address';
ok !network_contains('10.10.10.8/29', '10.10.10.7'), 'v4 network does
not contain address';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/t/mojolicious/commands.t
new/Mojolicious-9.01/t/mojolicious/commands.t
--- old/Mojolicious-9.0/t/mojolicious/commands.t 2021-01-27
16:04:45.000000000 +0100
+++ new/Mojolicious-9.01/t/mojolicious/commands.t 2021-02-16
21:25:51.000000000 +0100
@@ -274,24 +274,24 @@
subtest 'Trusted proxies' => sub {
my $command = Mojolicious::Command::daemon->new;
- my $daemon = $command->build_server('-p', '127.0/8', '-p', '10.0/8');
+ my $daemon = $command->build_server('-p', '127.0.0.0/8', '-p',
'10.0.0.0/8');
ok $daemon->reverse_proxy, 'right value';
- is_deeply $daemon->trusted_proxies, ['127.0/8', '10.0/8'], 'right value';
+ is_deeply $daemon->trusted_proxies, ['127.0.0.0/8', '10.0.0.0/8'], 'right
value';
};
subtest 'Trusted proxies from environment' => sub {
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8,10.0/8';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8,10.0.0.0/8';
my $command = Mojolicious::Command::daemon->new;
my $daemon = $command->build_server;
ok $daemon->reverse_proxy, 'right value';
- is_deeply $daemon->trusted_proxies, ['127.0/8', '10.0/8'], 'right value';
+ is_deeply $daemon->trusted_proxies, ['127.0.0.0/8', '10.0.0.0/8'], 'right
value';
};
subtest 'Proxy boolean and trusted' => sub {
my $command = Mojolicious::Command::daemon->new;
- my $daemon = $command->build_server('-p', '-p', '127.0/8', '-p',
'10.0/8');
+ my $daemon = $command->build_server('-p', '-p', '127.0.0.0/8', '-p',
'10.0.0.0/8');
ok $daemon->reverse_proxy, 'right value';
- is_deeply $daemon->trusted_proxies, ['127.0/8', '10.0/8'], 'right value';
+ is_deeply $daemon->trusted_proxies, ['127.0.0.0/8', '10.0.0.0/8'], 'right
value';
};
};
@@ -493,24 +493,24 @@
subtest 'Trusted proxies' => sub {
my $command = Mojolicious::Command::prefork->new;
- my $prefork = $command->build_server('-p', '127.0/8', '-p', '10.0/8');
+ my $prefork = $command->build_server('-p', '127.0.0.0/8', '-p',
'10.0.0.0/8');
ok $prefork->reverse_proxy, 'right value';
- is_deeply $prefork->trusted_proxies, ['127.0/8', '10.0/8'], 'right value';
+ is_deeply $prefork->trusted_proxies, ['127.0.0.0/8', '10.0.0.0/8'], 'right
value';
};
subtest 'Trusted proxies from environment' => sub {
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8,10.0/8';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8,10.0.0.0/8';
my $command = Mojolicious::Command::prefork->new;
my $prefork = $command->build_server;
ok $prefork->reverse_proxy, 'right value';
- is_deeply $prefork->trusted_proxies, ['127.0/8', '10.0/8'], 'right value';
+ is_deeply $prefork->trusted_proxies, ['127.0.0.0/8', '10.0.0.0/8'], 'right
value';
};
subtest 'Proxy boolean and trusted' => sub {
my $command = Mojolicious::Command::prefork->new;
- my $prefork = $command->build_server('-p', '-p', '127.0/8', '-p',
'10.0/8');
+ my $prefork = $command->build_server('-p', '-p', '127.0.0.0/8', '-p',
'10.0.0.0/8');
ok $prefork->reverse_proxy, 'right value';
- is_deeply $prefork->trusted_proxies, ['127.0/8', '10.0/8'], 'right value';
+ is_deeply $prefork->trusted_proxies, ['127.0.0.0/8', '10.0.0.0/8'], 'right
value';
};
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.0/t/mojolicious/lite_app.t
new/Mojolicious-9.01/t/mojolicious/lite_app.t
--- old/Mojolicious-9.0/t/mojolicious/lite_app.t 2021-02-12
19:32:41.000000000 +0100
+++ new/Mojolicious-9.01/t/mojolicious/lite_app.t 2021-02-16
21:25:51.000000000 +0100
@@ -685,7 +685,7 @@
};
subtest 'Reverse proxy with "X-Forwarded-For" and trusted proxy networks' =>
sub {
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8, 192.0.2.1/32';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8, 192.0.2.1/32';
my $t = Test::Mojo->new;
$t->get_ok('/0' => {'X-Forwarded-For' => '192.0.2.2,
192.0.2.1'})->status_is(200)
->header_unlike('X-Original' => qr/192\.0\.2\.(?:2|1)/)
@@ -693,7 +693,7 @@
};
subtest 'Reverse proxy with "X-Forwarded-For" and trusted proxies (all
addresses trusted)' => sub {
- local $ENV{MOJO_TRUSTED_PROXIES} = '0/0';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '0.0.0.0/0';
my $t = Test::Mojo->new;
$t->get_ok('/0' => {'X-Forwarded-For' => '192.0.2.2,
192.0.2.1'})->status_is(200)
->header_unlike('X-Original' => qr/192\.0\.2\.(?:2|1)/)
@@ -701,7 +701,7 @@
};
subtest 'Reverse proxy with "X-Forwarded-For" and trusted proxies (unexpected
leading address)' => sub {
- local $ENV{MOJO_TRUSTED_PROXIES} = '127.0/8, 192.0.2.1';
+ local $ENV{MOJO_TRUSTED_PROXIES} = '127.0.0.0/8, 192.0.2.1';
my $t = Test::Mojo->new;
$t->get_ok('/0' => {'X-Forwarded-For' => '7.7.7.7, 192.0.2.2,
192.0.2.1'})->status_is(200)
->header_unlike('X-Original' => qr/192\.0\.2\.(?:2|1)/)