Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove base64 encoding supports in WMS responses
  • Loading branch information
dmarteau committed Jan 2, 2017
1 parent 3ba2f8e commit ddd5adf
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/server/qgshttprequesthandler.cpp
Expand Up @@ -259,7 +259,6 @@ void QgsHttpRequestHandler::setGetMapResponse( const QString& service, QImage* i
bool png16Bit = ( mFormatString.compare( QLatin1String( "image/png; mode=16bit" ), Qt::CaseInsensitive ) == 0 );
bool png8Bit = ( mFormatString.compare( QLatin1String( "image/png; mode=8bit" ), Qt::CaseInsensitive ) == 0 );
bool png1Bit = ( mFormatString.compare( QLatin1String( "image/png; mode=1bit" ), Qt::CaseInsensitive ) == 0 );
bool isBase64 = mFormatString.endsWith( QLatin1String( ";base64" ), Qt::CaseInsensitive );
if ( mFormat != QLatin1String( "PNG" ) && mFormat != QLatin1String( "JPG" ) && !png16Bit && !png8Bit && !png1Bit )
{
QgsMessageLog::logMessage( QStringLiteral( "service exception - incorrect image format requested..." ) );
Expand Down Expand Up @@ -303,10 +302,6 @@ void QgsHttpRequestHandler::setGetMapResponse( const QString& service, QImage* i
img->save( &buffer, mFormat.toUtf8().data(), imageQuality );
}

if ( isBase64 )
{
ba = ba.toBase64();
}
setHttpResponse( &ba, formatToMimeType( mFormat ) );
}
}
Expand Down Expand Up @@ -484,10 +479,6 @@ void QgsHttpRequestHandler::setServiceException( const QgsMapServiceException& e

void QgsHttpRequestHandler::setGetPrintResponse( QByteArray* ba )
{
if ( mFormatString.endsWith( QLatin1String( ";base64" ), Qt::CaseInsensitive ) )
{
*ba = ba->toBase64();
}
setHttpResponse( ba, formatToMimeType( mFormat ) );
}

Expand Down

0 comments on commit ddd5adf

Please sign in to comment.