From 4fc2c429f265c9dabfc38b08a2e971d32eca70b5 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Fri, 7 Feb 2025 11:10:14 +0100 Subject: [PATCH] [oapif] Fix regression missing auth headers Fixes #60473 --- src/providers/wfs/oapif/qgsoapifapirequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifcollection.cpp | 4 ++-- src/providers/wfs/oapif/qgsoapifconformancerequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifcreatefeaturerequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifdeletefeaturerequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifitemsrequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapiflandingpagerequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifoptionsrequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifpatchfeaturerequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifputfeaturerequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifqueryablesrequest.cpp | 2 +- src/providers/wfs/oapif/qgsoapifsingleitemrequest.cpp | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/providers/wfs/oapif/qgsoapifapirequest.cpp b/src/providers/wfs/oapif/qgsoapifapirequest.cpp index 4eddef7e3279..effc45a8f1af 100644 --- a/src/providers/wfs/oapif/qgsoapifapirequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifapirequest.cpp @@ -23,7 +23,7 @@ using namespace nlohmann; #include QgsOapifApiRequest::QgsOapifApiRequest( const QgsDataSourceUri &baseUri, const QString &url ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), QgsHttpHeaders(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main diff --git a/src/providers/wfs/oapif/qgsoapifcollection.cpp b/src/providers/wfs/oapif/qgsoapifcollection.cpp index 2bd9109e00e7..c8bc4c31d33c 100644 --- a/src/providers/wfs/oapif/qgsoapifcollection.cpp +++ b/src/providers/wfs/oapif/qgsoapifcollection.cpp @@ -370,7 +370,7 @@ bool QgsOapifCollection::deserialize( const json &j, const json &jCollections ) // ----------------------------------------- QgsOapifCollectionsRequest::QgsOapifCollectionsRequest( const QgsDataSourceUri &baseUri, const QString &url ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), QgsHttpHeaders(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main @@ -486,7 +486,7 @@ void QgsOapifCollectionsRequest::processReply() // ----------------------------------------- QgsOapifCollectionRequest::QgsOapifCollectionRequest( const QgsDataSourceUri &baseUri, const QString &url ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), QgsHttpHeaders(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main diff --git a/src/providers/wfs/oapif/qgsoapifconformancerequest.cpp b/src/providers/wfs/oapif/qgsoapifconformancerequest.cpp index df6a632d1ed3..011ebde800e3 100644 --- a/src/providers/wfs/oapif/qgsoapifconformancerequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifconformancerequest.cpp @@ -25,7 +25,7 @@ using namespace nlohmann; #include QgsOapifConformanceRequest::QgsOapifConformanceRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main diff --git a/src/providers/wfs/oapif/qgsoapifcreatefeaturerequest.cpp b/src/providers/wfs/oapif/qgsoapifcreatefeaturerequest.cpp index 3f16895f4894..203f351900a6 100644 --- a/src/providers/wfs/oapif/qgsoapifcreatefeaturerequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifcreatefeaturerequest.cpp @@ -23,7 +23,7 @@ using namespace nlohmann; #include "qgsoapifprovider.h" QgsOapifCreateFeatureRequest::QgsOapifCreateFeatureRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ) { } diff --git a/src/providers/wfs/oapif/qgsoapifdeletefeaturerequest.cpp b/src/providers/wfs/oapif/qgsoapifdeletefeaturerequest.cpp index 5d6238e09c57..1ec23e3b7a8e 100644 --- a/src/providers/wfs/oapif/qgsoapifdeletefeaturerequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifdeletefeaturerequest.cpp @@ -18,7 +18,7 @@ #include "moc_qgsoapifdeletefeaturerequest.cpp" QgsOapifDeleteFeatureRequest::QgsOapifDeleteFeatureRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ) { } diff --git a/src/providers/wfs/oapif/qgsoapifitemsrequest.cpp b/src/providers/wfs/oapif/qgsoapifitemsrequest.cpp index b8e182992a2b..470ab3ecb570 100644 --- a/src/providers/wfs/oapif/qgsoapifitemsrequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifitemsrequest.cpp @@ -27,7 +27,7 @@ using namespace nlohmann; #include QgsOapifItemsRequest::QgsOapifItemsRequest( const QgsDataSourceUri &baseUri, const QString &url ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), QgsHttpHeaders(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main diff --git a/src/providers/wfs/oapif/qgsoapiflandingpagerequest.cpp b/src/providers/wfs/oapif/qgsoapiflandingpagerequest.cpp index ec7591d7de14..292de9d359ae 100644 --- a/src/providers/wfs/oapif/qgsoapiflandingpagerequest.cpp +++ b/src/providers/wfs/oapif/qgsoapiflandingpagerequest.cpp @@ -25,7 +25,7 @@ using namespace nlohmann; #include QgsOapifLandingPageRequest::QgsOapifLandingPageRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ), mUri( uri ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ), mUri( uri ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main diff --git a/src/providers/wfs/oapif/qgsoapifoptionsrequest.cpp b/src/providers/wfs/oapif/qgsoapifoptionsrequest.cpp index 3f07f4079b3a..6f899d062f5e 100644 --- a/src/providers/wfs/oapif/qgsoapifoptionsrequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifoptionsrequest.cpp @@ -17,7 +17,7 @@ #include "moc_qgsoapifoptionsrequest.cpp" QgsOapifOptionsRequest::QgsOapifOptionsRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ) { } diff --git a/src/providers/wfs/oapif/qgsoapifpatchfeaturerequest.cpp b/src/providers/wfs/oapif/qgsoapifpatchfeaturerequest.cpp index 06805e2866be..44f900e5e36b 100644 --- a/src/providers/wfs/oapif/qgsoapifpatchfeaturerequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifpatchfeaturerequest.cpp @@ -23,7 +23,7 @@ using namespace nlohmann; #include "qgsoapifprovider.h" QgsOapifPatchFeatureRequest::QgsOapifPatchFeatureRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ) { } diff --git a/src/providers/wfs/oapif/qgsoapifputfeaturerequest.cpp b/src/providers/wfs/oapif/qgsoapifputfeaturerequest.cpp index 3a782499326c..d8d476a6c82b 100644 --- a/src/providers/wfs/oapif/qgsoapifputfeaturerequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifputfeaturerequest.cpp @@ -23,7 +23,7 @@ using namespace nlohmann; #include "qgsoapifprovider.h" QgsOapifPutFeatureRequest::QgsOapifPutFeatureRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ) { } diff --git a/src/providers/wfs/oapif/qgsoapifqueryablesrequest.cpp b/src/providers/wfs/oapif/qgsoapifqueryablesrequest.cpp index b98536452539..024a1302d050 100644 --- a/src/providers/wfs/oapif/qgsoapifqueryablesrequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifqueryablesrequest.cpp @@ -25,7 +25,7 @@ using namespace nlohmann; #include QgsOapifQueryablesRequest::QgsOapifQueryablesRequest( const QgsDataSourceUri &uri ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), uri.authConfigId() ), "OAPIF" ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( uri.username(), uri.password(), QgsHttpHeaders(), uri.authConfigId() ), "OAPIF" ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main diff --git a/src/providers/wfs/oapif/qgsoapifsingleitemrequest.cpp b/src/providers/wfs/oapif/qgsoapifsingleitemrequest.cpp index c02caee2380b..245e43f0042a 100644 --- a/src/providers/wfs/oapif/qgsoapifsingleitemrequest.cpp +++ b/src/providers/wfs/oapif/qgsoapifsingleitemrequest.cpp @@ -25,7 +25,7 @@ #include QgsOapifSingleItemRequest::QgsOapifSingleItemRequest( const QgsDataSourceUri &baseUri, const QString &url ) - : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) + : QgsBaseNetworkRequest( QgsAuthorizationSettings( baseUri.username(), baseUri.password(), QgsHttpHeaders(), baseUri.authConfigId() ), tr( "OAPIF" ) ), mUrl( url ) { // Using Qt::DirectConnection since the download might be running on a different thread. // In this case, the request was sent from the main thread and is executed with the main