Skip to content

Commit

Permalink
wms provider: handle content type case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 20, 2012
1 parent 3147836 commit 7cdd446
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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() )
Expand All @@ -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 );
}
Expand Down

0 comments on commit 7cdd446

Please sign in to comment.