Skip to content

Commit

Permalink
Test PLACK_ENV before comparing to string
Browse files Browse the repository at this point in the history
to avoid undef warning in tests
  • Loading branch information
rwstauner committed Jun 27, 2014
1 parent 2149422 commit ba7a6c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.psgi
Expand Up @@ -5,6 +5,8 @@ package MetaCPAN::Web;
use strict;
use warnings;

# TODO: When we know everything will work reliably: $ENV{PLACK_ENV} ||= 'development';

BEGIN {
if ( $ENV{PLACK_ENV} && $ENV{PLACK_ENV} eq 'development' ) {
$ENV{PLACK_SERVER} = 'Standalone';
Expand Down Expand Up @@ -53,7 +55,7 @@ my $app = Plack::App::URLMap->new;
$core_app,
session_key => 'metacpan_secure',
expires => 2**30,
secure => ( $ENV{PLACK_ENV} ne 'development' ),
secure => ( ( $ENV{PLACK_ENV} || '' ) ne 'development' ),
httponly => 1,
);

Expand Down

0 comments on commit ba7a6c5

Please sign in to comment.