Skip to content

Commit

Permalink
make searching for headers case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Aug 28, 2022
1 parent a95b213 commit 5393b8b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/core/pointcloud/qgslazinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,17 @@ bool QgsLazInfo::supportsRangeQueries( QUrl &url )
QgsBlockingNetworkRequest req;
QgsBlockingNetworkRequest::ErrorCode errCode = req.head( nr );
QgsNetworkReplyContent reply = req.reply();
const QList<QgsNetworkReplyContent::RawHeaderPair> pairs = reply.rawHeaderPairs();
bool acceptsRanges = false;
for ( const auto &pair : pairs )
{
if ( QString::fromLocal8Bit( pair.first ).compare( QStringLiteral( "Accept-Ranges" ), Qt::CaseInsensitive ) == 0 &&
QString::fromLocal8Bit( pair.second ).compare( QStringLiteral( "bytes" ), Qt::CaseInsensitive ) == 0 )
{
acceptsRanges = true;
break;
}
}

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

0 comments on commit 5393b8b

Please sign in to comment.