Skip to content

Commit

Permalink
Item4466: Don't crash when run from command line
Browse files Browse the repository at this point in the history
Configure expects HTTP environment to be set,  can't even debug
configure from the shell.

git-svn-id: http://svn.foswiki.org/trunk@17640 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed May 6, 2014
1 parent cb06ba5 commit aaeb4f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/lib/Foswiki/Configure/Dispatch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ exit(1);
sub _validateConfigure {
my ( $action, $session, $cookie ) = @_;

if ( $method !~ /^(GET|POST)$/ ) {
if ( defined $method && $method !~ /^(GET|POST)$/ ) {
invalidRequest( "", 405, Allow => 'GET,POST' );
}

Expand Down Expand Up @@ -1040,7 +1040,7 @@ sub htmlResponse {
my ( $moreOutput, $noRedirect, $errForm ) = $flags =~ /(.)(.)(.)$/;
$noRedirect = 1 if (@feedbackHeaders);

if ( $method eq 'POST' && !$noRedirect ) {
if ( defined $method && $method eq 'POST' && !$noRedirect ) {
htmlRedirect(
'DisplayResults',
{
Expand All @@ -1057,7 +1057,7 @@ sub htmlResponse {
400 => { msg => 'Invalid Request' },
401 => { msg => 'Not authorized' },
404 => { msg => 'Not found' },
405 => { msg => "Method $method not allowed" },
405 => { msg => "Method " . ( $method || 'undef' ) . " not allowed" },
}->{$status}
or die "Invalid status";

Expand Down

0 comments on commit aaeb4f4

Please sign in to comment.