Skip to content

Commit 7cdd446

Browse files
committedApr 20, 2012
wms provider: handle content type case insensitive
1 parent 3147836 commit 7cdd446

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,10 @@ void QgsWmsProvider::tileReplyFinished()
801801

802802
QString contentType = reply->header( QNetworkRequest::ContentTypeHeader ).toString();
803803
QgsDebugMsg( "contentType: " + contentType );
804-
if ( !contentType.startsWith( "image/" ) )
804+
if ( !contentType.startsWith( "image/", Qt::CaseInsensitive ) )
805805
{
806806
QByteArray text = reply->readAll();
807-
if ( contentType == "text/xml" && parseServiceExceptionReportDom( text ) )
807+
if ( contentType.toLower() == "text/xml" && parseServiceExceptionReportDom( text ) )
808808
{
809809
showMessageBox( mErrorCaption, mError );
810810
}
@@ -909,7 +909,7 @@ void QgsWmsProvider::cacheReplyFinished()
909909

910910
QString contentType = cacheReply->header( QNetworkRequest::ContentTypeHeader ).toString();
911911
QgsDebugMsg( "contentType: " + contentType );
912-
if ( contentType.startsWith( "image/" ) )
912+
if ( contentType.startsWith( "image/", Qt::CaseInsensitive ) )
913913
{
914914
QImage myLocalImage = QImage::fromData( cacheReply->readAll() );
915915
if ( !myLocalImage.isNull() )
@@ -925,7 +925,7 @@ void QgsWmsProvider::cacheReplyFinished()
925925
else
926926
{
927927
QByteArray text = cacheReply->readAll();
928-
if ( contentType == "text/xml" && parseServiceExceptionReportDom( text ) )
928+
if ( contentType.toLower() == "text/xml" && parseServiceExceptionReportDom( text ) )
929929
{
930930
showMessageBox( mErrorCaption, mError );
931931
}

0 commit comments

Comments
 (0)
Please sign in to comment.