Skip to content

Commit cd970f2

Browse files
authored
Merge pull request #3897 from dmarteau/removeBase64
Server: Remove base64 encoding supports in WMS responses
2 parents 3ba2f8e + ddd5adf commit cd970f2

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/server/qgshttprequesthandler.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ void QgsHttpRequestHandler::setGetMapResponse( const QString& service, QImage* i
259259
bool png16Bit = ( mFormatString.compare( QLatin1String( "image/png; mode=16bit" ), Qt::CaseInsensitive ) == 0 );
260260
bool png8Bit = ( mFormatString.compare( QLatin1String( "image/png; mode=8bit" ), Qt::CaseInsensitive ) == 0 );
261261
bool png1Bit = ( mFormatString.compare( QLatin1String( "image/png; mode=1bit" ), Qt::CaseInsensitive ) == 0 );
262-
bool isBase64 = mFormatString.endsWith( QLatin1String( ";base64" ), Qt::CaseInsensitive );
263262
if ( mFormat != QLatin1String( "PNG" ) && mFormat != QLatin1String( "JPG" ) && !png16Bit && !png8Bit && !png1Bit )
264263
{
265264
QgsMessageLog::logMessage( QStringLiteral( "service exception - incorrect image format requested..." ) );
@@ -303,10 +302,6 @@ void QgsHttpRequestHandler::setGetMapResponse( const QString& service, QImage* i
303302
img->save( &buffer, mFormat.toUtf8().data(), imageQuality );
304303
}
305304

306-
if ( isBase64 )
307-
{
308-
ba = ba.toBase64();
309-
}
310305
setHttpResponse( &ba, formatToMimeType( mFormat ) );
311306
}
312307
}
@@ -484,10 +479,6 @@ void QgsHttpRequestHandler::setServiceException( const QgsMapServiceException& e
484479

485480
void QgsHttpRequestHandler::setGetPrintResponse( QByteArray* ba )
486481
{
487-
if ( mFormatString.endsWith( QLatin1String( ";base64" ), Qt::CaseInsensitive ) )
488-
{
489-
*ba = ba->toBase64();
490-
}
491482
setHttpResponse( ba, formatToMimeType( mFormat ) );
492483
}
493484

0 commit comments

Comments
 (0)