Skip to content

Commit

Permalink
fixed another cookie quoting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 2, 2013
1 parent bb1c32f commit ab42300
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Changes
Expand Up @@ -2,7 +2,7 @@
4.11 2013-06-03
- Added allow and append methods to Mojo::Headers.
- Added split_header function to Mojo::Util.
- Fixed cookie quoting bugs in Mojo::Cookie::Response.
- Fixed cookie quoting bugs.
- Fixed a few small boundary and charset detection bugs in Mojo::Content.
- Fixed a few small filename detection bugs in Mojo::Message.
- Fixed small quality detection bug in Mojolicious::Types.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Cookie/Request.pm
Expand Up @@ -21,7 +21,7 @@ sub to_string {
my $self = shift;
return '' unless my $name = $self->name;
my $value = $self->value // '';
$value = $value =~ /[,;"]/ ? quote($value) : $value;
$value = $value =~ /[,;" ]/ ? quote($value) : $value;
return "$name=$value";
}

Expand Down
2 changes: 1 addition & 1 deletion t/mojo/cookie.t
Expand Up @@ -8,7 +8,7 @@ use Mojo::Cookie::Response;
my $cookie = Mojo::Cookie::Request->new;
$cookie->name('foo');
$cookie->value('ba =r');
is $cookie->to_string, 'foo=ba =r', 'right format';
is $cookie->to_string, 'foo="ba =r"', 'right format';

# Request cookie without value as string
$cookie = Mojo::Cookie::Request->new;
Expand Down

0 comments on commit ab42300

Please sign in to comment.