mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
wms provider: handle content type case insensitive
This commit is contained in:
parent
314783619b
commit
7cdd446a9e
@ -801,10 +801,10 @@ void QgsWmsProvider::tileReplyFinished()
|
||||
|
||||
QString contentType = reply->header( QNetworkRequest::ContentTypeHeader ).toString();
|
||||
QgsDebugMsg( "contentType: " + contentType );
|
||||
if ( !contentType.startsWith( "image/" ) )
|
||||
if ( !contentType.startsWith( "image/", Qt::CaseInsensitive ) )
|
||||
{
|
||||
QByteArray text = reply->readAll();
|
||||
if ( contentType == "text/xml" && parseServiceExceptionReportDom( text ) )
|
||||
if ( contentType.toLower() == "text/xml" && parseServiceExceptionReportDom( text ) )
|
||||
{
|
||||
showMessageBox( mErrorCaption, mError );
|
||||
}
|
||||
@ -909,7 +909,7 @@ void QgsWmsProvider::cacheReplyFinished()
|
||||
|
||||
QString contentType = cacheReply->header( QNetworkRequest::ContentTypeHeader ).toString();
|
||||
QgsDebugMsg( "contentType: " + contentType );
|
||||
if ( contentType.startsWith( "image/" ) )
|
||||
if ( contentType.startsWith( "image/", Qt::CaseInsensitive ) )
|
||||
{
|
||||
QImage myLocalImage = QImage::fromData( cacheReply->readAll() );
|
||||
if ( !myLocalImage.isNull() )
|
||||
@ -925,7 +925,7 @@ void QgsWmsProvider::cacheReplyFinished()
|
||||
else
|
||||
{
|
||||
QByteArray text = cacheReply->readAll();
|
||||
if ( contentType == "text/xml" && parseServiceExceptionReportDom( text ) )
|
||||
if ( contentType.toLower() == "text/xml" && parseServiceExceptionReportDom( text ) )
|
||||
{
|
||||
showMessageBox( mErrorCaption, mError );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user