Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix unintended replacement of percent encoded URL parts
  • Loading branch information
pathmapper authored and nyalldawson committed Apr 1, 2023
1 parent 53a71e5 commit b29bb72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/server/services/wfs3/qgswfs3handlers.cpp
Expand Up @@ -1403,7 +1403,7 @@ void QgsWfs3CollectionsItemsHandler::handleRequest( const QgsServerApiContext &c
if ( offset != 0 )
{
json prevLink = selfLink;
prevLink["href"] = QStringLiteral( "%1offset=%2&limit=%3" ).arg( cleanedUrlAsString ).arg( std::max<long>( 0, offset - limit ) ).arg( limit ).toStdString();
prevLink["href"] = cleanedUrlAsString.toStdString() + QStringLiteral( "offset=%1&limit=%2" ).arg( std::max<long>( 0, offset - limit ) ).arg( limit ).toStdString();
prevLink["rel"] = "prev";
prevLink["title"] = "Previous page";
data["links"].push_back( prevLink );
Expand All @@ -1412,7 +1412,7 @@ void QgsWfs3CollectionsItemsHandler::handleRequest( const QgsServerApiContext &c
if ( limit + offset < matchedFeaturesCount )
{
json nextLink = selfLink;
nextLink["href"] = QStringLiteral( "%1offset=%2&limit=%3" ).arg( cleanedUrlAsString ).arg( std::min<long>( matchedFeaturesCount, limit + offset ) ).arg( limit ).toStdString();
nextLink["href"] = cleanedUrlAsString.toStdString() + QStringLiteral( "offset=%1&limit=%2" ).arg( std::min<long>( matchedFeaturesCount, limit + offset ) ).arg( limit ).toStdString();
nextLink["rel"] = "next";
nextLink["title"] = "Next page";
data["links"].push_back( nextLink );
Expand Down
Expand Up @@ -985,7 +985,7 @@ Content-Type: application/geo+json
"type": "text/html"
},
{
"href": "http://server.qgis.org/wfs3/collections/as-areas-short-name/items?crs=http10A10F10Fwww.opengis.net10Fdef10Fcrs10FEPSG10F010F3857&offset=10&limit=10",
"href": "http://server.qgis.org/wfs3/collections/as-areas-short-name/items?crs=http%3A%2F%2Fwww.opengis.net%2Fdef%2Fcrs%2FEPSG%2F0%2F3857&offset=10&limit=10",
"rel": "next",
"title": "Next page",
"type": "application/geo+json"
Expand Down
Expand Up @@ -985,7 +985,7 @@ Content-Type: application/geo+json
"type": "text/html"
},
{
"href": "http://server.qgis.org/wfs3/collections/as-areas-short-name/items?crs=http10A10F10Fwww.opengis.net10Fdef10Fcrs10FEPSG10F010F4326&offset=10&limit=10",
"href": "http://server.qgis.org/wfs3/collections/as-areas-short-name/items?crs=http%3A%2F%2Fwww.opengis.net%2Fdef%2Fcrs%2FEPSG%2F0%2F4326&offset=10&limit=10",
"rel": "next",
"title": "Next page",
"type": "application/geo+json"
Expand Down

0 comments on commit b29bb72

Please sign in to comment.