@@ -1126,7 +1126,8 @@ void QgsWmsProvider::tileReplyFinished()
1126
1126
1127
1127
QString contentType = reply->header ( QNetworkRequest::ContentTypeHeader ).toString ();
1128
1128
QgsDebugMsg ( " contentType: " + contentType );
1129
- if ( !contentType.startsWith ( " image/" , Qt::CaseInsensitive ) )
1129
+ if ( !contentType.startsWith ( " image/" , Qt::CaseInsensitive ) &&
1130
+ contentType.compare ( " application/octet-stream" , Qt::CaseInsensitive ) != 0 )
1130
1131
{
1131
1132
QByteArray text = reply->readAll ();
1132
1133
if ( contentType.toLower () == " text/xml" && parseServiceExceptionReportDom ( text ) )
@@ -1188,7 +1189,8 @@ void QgsWmsProvider::tileReplyFinished()
1188
1189
}
1189
1190
else
1190
1191
{
1191
- QgsMessageLog::logMessage ( tr ( " Returned image is flawed [%1]" ).arg ( reply->url ().toString () ), tr ( " WMS" ) );
1192
+ QgsMessageLog::logMessage ( tr ( " Returned image is flawed [Content-Type:%1; URL: %2]" )
1193
+ .arg ( contentType ).arg ( reply->url ().toString () ), tr ( " WMS" ) );
1192
1194
}
1193
1195
}
1194
1196
else
@@ -1263,7 +1265,8 @@ void QgsWmsProvider::cacheReplyFinished()
1263
1265
1264
1266
QString contentType = mCacheReply ->header ( QNetworkRequest::ContentTypeHeader ).toString ();
1265
1267
QgsDebugMsg ( " contentType: " + contentType );
1266
- if ( contentType.startsWith ( " image/" , Qt::CaseInsensitive ) )
1268
+ if ( contentType.startsWith ( " image/" , Qt::CaseInsensitive ) ||
1269
+ contentType.compare ( " application/octet-stream" , Qt::CaseInsensitive ) == 0 )
1267
1270
{
1268
1271
QImage myLocalImage = QImage::fromData ( mCacheReply ->readAll () );
1269
1272
if ( !myLocalImage.isNull () )
@@ -1273,7 +1276,8 @@ void QgsWmsProvider::cacheReplyFinished()
1273
1276
}
1274
1277
else
1275
1278
{
1276
- QgsMessageLog::logMessage ( tr ( " Returned image is flawed [%1]" ).arg ( mCacheReply ->url ().toString () ), tr ( " WMS" ) );
1279
+ QgsMessageLog::logMessage ( tr ( " Returned image is flawed [Content-Type:%1; URL:%2]" )
1280
+ .arg ( contentType ).arg ( mCacheReply ->url ().toString () ), tr ( " WMS" ) );
1277
1281
}
1278
1282
}
1279
1283
else
@@ -1287,9 +1291,10 @@ void QgsWmsProvider::cacheReplyFinished()
1287
1291
}
1288
1292
else
1289
1293
{
1290
- QgsMessageLog::logMessage ( tr ( " Map request error (Status: %1; Response: %2; URL:%3 )" )
1294
+ QgsMessageLog::logMessage ( tr ( " Map request error (Status: %1; Response: %2; Content-Type: %3; URL:%4 )" )
1291
1295
.arg ( status.toInt () )
1292
1296
.arg ( QString::fromUtf8 ( text ) )
1297
+ .arg ( contentType )
1293
1298
.arg ( mCacheReply ->url ().toString () ), tr ( " WMS" ) );
1294
1299
}
1295
1300
0 commit comments