Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ignore return code when checking if server supports range requests
  • Loading branch information
uclaros authored and nyalldawson committed Sep 22, 2022
1 parent ba13472 commit 3511cf8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/pointcloud/qgslazinfo.cpp
Expand Up @@ -353,9 +353,10 @@ bool QgsLazInfo::supportsRangeQueries( QUrl &url )
nr.setAttribute( QNetworkRequest::CacheSaveControlAttribute, false );
nr.setRawHeader( "Range", "bytes=0-0" );
QgsBlockingNetworkRequest req;
QgsBlockingNetworkRequest::ErrorCode errCode = req.head( nr );
// ignore the reply's status, we only care if accept-ranges is in the headers
req.head( nr );
QgsNetworkReplyContent reply = req.reply();

QString acceptRangesHeader = reply.rawHeader( QStringLiteral( "Accept-Ranges" ).toLocal8Bit() );
return errCode == QgsBlockingNetworkRequest::NoError && acceptRangesHeader.compare( QStringLiteral( "bytes" ), Qt::CaseSensitivity::CaseInsensitive ) == 0;
const QString acceptRangesHeader = reply.rawHeader( QStringLiteral( "Accept-Ranges" ).toLocal8Bit() );
return acceptRangesHeader.compare( QStringLiteral( "bytes" ), Qt::CaseSensitivity::CaseInsensitive ) == 0;
}

0 comments on commit 3511cf8

Please sign in to comment.