Skip to content

Commit 2641b3f

Browse files
committedJan 22, 2019
Allow REQUEST_BODY in tests even if QGISDEBUG is off
1 parent 4592fa7 commit 2641b3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/server/qgsfcgiserverrequest.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ void QgsFcgiServerRequest::readData()
139139
{
140140
bool success = false;
141141
int length = QString( lengthstr ).toInt( &success );
142-
#ifdef QGISDEBUG
142+
// Note: REQUEST_BODY is not part of CGI standard, and it is not
143+
// normally passed by any CGI web server and it is implemented only
144+
// to allow unit tests to inject a request body and simulate a POST
145+
// request
143146
const char *request_body = getenv( "REQUEST_BODY" );
144147
if ( success && request_body )
145148
{
@@ -148,6 +151,7 @@ void QgsFcgiServerRequest::readData()
148151
mData.append( body.toUtf8() );
149152
length = 0;
150153
}
154+
#ifdef QGISDEBUG
151155
qDebug() << "fcgi: reading " << lengthstr << " bytes from " << ( request_body ? "REQUEST_BODY" : "stdin" );
152156
#endif
153157
if ( success )

0 commit comments

Comments
 (0)
Please sign in to comment.