5.7006
- Updated HTTP::Body dependency to 0.6, 0.5 can break on large POST requests.
+ - Skip utf8 fix for undef values in uri_with() and uri_for()
5.7005 2006-11-07 19:37:35
- Fixed lighttpd tests to be properly skipped.
( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} );
for my $value ( values %$params ) {
+ next unless defined $value;
for ( ref $value eq 'ARRAY' ? @$value : $value ) {
$_ = "$_";
utf8::encode( $_ );
carp( 'No arguments passed to uri_with()' ) unless $args;
for my $value ( values %$args ) {
+ next unless defined $value;
for ( ref $value eq 'ARRAY' ? @$value : $value ) {
$_ = "$_";
utf8::encode( $_ );
$c->forward('TestApp::View::Dump::Request');\r
}\r
\r
+sub uri_with_undef : Local {\r
+ my ( $self, $c ) = @_;\r
+
+ my $warnings = 0;
+ local $SIG{__WARN__} = sub { $warnings++ };\r
+\r
+ # change the current uri
+ my $uri = $c->req->uri_with( { foo => undef } );\r
+ \r
+ $c->res->header( 'X-Catalyst-warnings' => $warnings );\r
+ \r
+ $c->forward('TestApp::View::Dump::Request');\r
+}\r
+\r
1;\r
use FindBin;\r
use lib "$FindBin::Bin/lib";\r
\r
-use Test::More tests => 41;\r
+use Test::More tests => 44;\r
use Catalyst::Test 'TestApp';\r
use Catalyst::Request;\r
\r
ok( $response->is_success, 'Response Successful 2xx' );\r
like( $response->header( 'X-Catalyst-uri-with' ), qr/%E2%98%A0$/, 'uri_with ok' );\r
}\r
+
+# test with undef -- no warnings should be thrown\r
+{\r
+ ok( my $response = request("http://localhost/engine/request/uri/uri_with_undef"), 'Request' );\r
+ ok( $response->is_success, 'Response Successful 2xx' );\r
+ is( $response->header( 'X-Catalyst-warnings' ), 0, 'no warnings emitted' );\r
+}\r
use strict;
use warnings;
-use Test::More tests => 10;
+use Test::More tests => 11;
use URI;
use_ok('Catalyst');
'http://127.0.0.1/bar/baz', 'URI with no base or match' );
}
+# test with undef -- no warnings should be thrown
+{
+ my $warnings = 0;
+ local $SIG{__WARN__} = sub { $warnings++ };
+
+ Catalyst::uri_for( $context, '/bar/baz', { foo => undef } )->as_string,
+ is( $warnings, 0, "no warnings emitted" );
+}
+