Skip to content

Commit

Permalink
sent multiple line per cookie, navigators need this and doesn t suppo…
Browse files Browse the repository at this point in the history
…rt the advice spec
  • Loading branch information
geistteufel authored and Alexis Sukrieh committed Mar 1, 2011
1 parent 676d68f commit 1f2023c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Dancer/Renderer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ sub response_with_headers {
}
}
if (scalar @cookies) {
my $header = join ', ', @cookies;
$response->header('Set-Cookie' => $header);
foreach my $header(@cookies) {
$response->push_header('Set-Cookie',$header);
}
}

return $response;
Expand Down
14 changes: 14 additions & 0 deletions lib/Dancer/Response.pm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ sub header {
}
}

sub push_header {
my $self = shift;
my $header = shift;

if (@_) {
foreach my $h(@_) {
$self->{headers}->push_header( $header => $h );
}
}
else {
return $self->{headers}->header($header);
}
}

sub headers {
my $self = shift;
$self->{headers}->header(@_);
Expand Down

0 comments on commit 1f2023c

Please sign in to comment.