Skip to content
Permalink
Browse files

Item12832: Improve error message for GET vs POST

git-svn-id: http://svn.foswiki.org/branches/Release01x01@17464 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information...
GeorgeClark GeorgeClark
GeorgeClark authored and GeorgeClark committed Apr 2, 2014
1 parent 076de55 commit 550079f10fcd99000dc71674d8bec5bd5ebd3b62
Showing with 19 additions and 3 deletions.
  1. +19 −3 core/lib/Foswiki/UI.pm
@@ -265,10 +265,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} } );

0 comments on commit 550079f

Please sign in to comment.
You can’t perform that action at this time.