Skip to content

Commit 9e0e21a

Browse files
committed
Ensure cookie variable is accessible
1 parent 618ace7 commit 9e0e21a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app.psgi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ my $app = Plack::App::URLMap->new;
8383
},
8484
deserializer => sub {
8585

86+
# We can't reference $_[0] from inside the try block.
87+
my $cookie = $_[0];
88+
8689
# Use try/catch so JSON doesn't barf if the cookie is bad.
8790
try {
88-
JSON::decode_json( MIME::Base64::decode( $_[0] ) );
91+
JSON::decode_json( MIME::Base64::decode($cookie) );
8992
}
9093

9194
# No session.

0 commit comments

Comments
 (0)