Skip to content

Commit

Permalink
Item12832: Improve error message for GET vs POST
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@17465 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Apr 2, 2014
1 parent f783768 commit 693b30b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions core/lib/Foswiki/UI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,26 @@ sub handleRequest {
{
$res = new Foswiki::Response();
$res->header( -type => 'text/html', -status => '405' );
$res->print( 'Bad Request: '
$res->print( '<H1>Bad Request:</H1> The request method: '
. uc( $req->method() )
. ' denied for '
. $req->action() );
. ' is denied for the '
. $req->action()
. ' action.' );
if ( uc( $req->method() ) eq 'GET' ) {
$res->print( '<br/><br/>'
. 'The <tt><b>'
. $req->action()
. '</b></tt> script can only be called with the <tt>POST</tt> type method'
. '<br/><br/>'
. 'For example:<br/>'
. '&nbsp;&nbsp;&nbsp;<tt>&lt;form method="post" action="%SCRIPTURL{'
. $req->action()
. '}%/%WEB%/%TOPIC%"&gt;</tt><br/>'
. '<br/><br/>See <a href="http://foswiki.org/System/CommandAndCGIScripts#A_61'
. $req->action()
. '_61">System.CommandAndCGIScripts</a> for more information.'
);
}
return $res;
}
$res = _execute( $req, \&$sub, %{ $dispatcher->{context} } );
Expand Down

0 comments on commit 693b30b

Please sign in to comment.