File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -461,10 +461,13 @@ QByteArray QgsSvgCache::getImageData( const QString &path ) const
461
461
return mMissingSvg ;
462
462
}
463
463
464
+ // we accept both real SVG mime types AND plain text types - because some sites
465
+ // (notably github) serve up svgs as raw text
464
466
QString contentType = reply->header ( QNetworkRequest::ContentTypeHeader ).toString ();
465
- QgsDebugMsg ( " contentType: " + contentType );
466
- if ( !contentType.startsWith ( QLatin1String ( " image/svg+xml " ), Qt::CaseInsensitive ) )
467
+ if ( ! contentType. startsWith ( QLatin1String ( " image/svg+xml " ), Qt::CaseInsensitive )
468
+ && !contentType.startsWith ( QLatin1String ( " text/plain " ), Qt::CaseInsensitive ) )
467
469
{
470
+ QgsMessageLog::logMessage ( tr ( " Unexpected MIME type %1 received for %2" ).arg ( contentType, path ), tr ( " SVG" ) );
468
471
reply->deleteLater ();
469
472
return mMissingSvg ;
470
473
}
You can’t perform that action at this time.
0 commit comments