Skip to content

Commit

Permalink
Allow REQUEST_BODY in tests even if QGISDEBUG is off
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jan 22, 2019
1 parent 4592fa7 commit 2641b3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server/qgsfcgiserverrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ void QgsFcgiServerRequest::readData()
{
bool success = false;
int length = QString( lengthstr ).toInt( &success );
#ifdef QGISDEBUG
// Note: REQUEST_BODY is not part of CGI standard, and it is not
// normally passed by any CGI web server and it is implemented only
// to allow unit tests to inject a request body and simulate a POST
// request
const char *request_body = getenv( "REQUEST_BODY" );
if ( success && request_body )
{
Expand All @@ -148,6 +151,7 @@ void QgsFcgiServerRequest::readData()
mData.append( body.toUtf8() );
length = 0;
}
#ifdef QGISDEBUG
qDebug() << "fcgi: reading " << lengthstr << " bytes from " << ( request_body ? "REQUEST_BODY" : "stdin" );
#endif
if ( success )
Expand Down

0 comments on commit 2641b3f

Please sign in to comment.