# This file documents the revision history for Perl extension Catalyst.
+5.90073 - 2014-09-23
+ - Fixed a regression caused by the last release where we broke what happened
+ when you tried to set request parameters via $c->req->param('foo', 'bar').
+ You shouldn't do this, but I guess I shouldn't have busted it either :)
+ - Allow the term_width to be regenerated (see Catalyst::Utils::term_width,
+ Frew Schmidt)
+ - More aggressive skipping of value decoding if the value is undefined.
+
5.90072 - 2014-09-15
- In the case where you call $c->req->param(undef), warn with a more useful
warning (now gives the line of your code that called param with the undef,
__PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC);
# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.90072';
+our $VERSION = '5.90073';
sub import {
my ( $class, @arguments ) = @_;
return unless defined $value;
+ ## I think this mess is to support the old nested
if ( ref $value eq 'ARRAY' ) {
foreach ( @$value ) {
$_ = $self->_handle_unicode_decoding($_);
sub _handle_param_unicode_decoding {
my ( $self, $value ) = @_;
+ return unless defined $value; # not in love with just ignoring undefs - jnap
+
my $enc = $self->encoding;
return try {
Encode::is_utf8( $value ) ?
}
elsif ( @params > 1 ) {
my $field = shift @params;
- $self->parameters->{$field} = [@_];
+ $self->parameters->{$field} = [@params];
}
}
# Remember to update this in Catalyst as well!
-our $VERSION = '5.90072';
+our $VERSION = '5.90073';
=head1 NAME
As last resort, default value of 80 chars will be used.
+Calling C<term_width> with a true value will cause it to be recalculated; you
+can use this to cause it to get recalculated when your terminal is resized like
+this
+
+ $SIG{WINCH} = sub { Catalyst::Utils::term_width(1) };
+
=cut
my $_term_width;
sub term_width {
+ my $force_reset = shift;
+
+ undef $_term_width if $force_reset;
+
return $_term_width if $_term_width;
my $width;
$c->response->body("This is the body");
}
+ sub set_params :Local {
+ my ($self, $c) = @_;
+ $c->req->param(foo => 'a', 'b', 'c');
+ $c->res->body(join ',', $c->req->param('foo'));
+ }
+
package MyApp;
use Catalyst;
test_psgi $psgi, sub {
my $cb = shift;
- my $res = $cb->(GET "/root/test");
- is $res->code, 200, 'OK';
+
+ {
+ my $res = $cb->(GET "/root/test");
+ is $res->code, 200, 'OK';
+ }
+
+ {
+ my $res = $cb->(GET "/root/set_params");
+ is $res->code, 200, 'OK';
+ is $res->content, 'a,b,c';
+ }
};
done_testing;