From 492c629e2a24151f7e66033b43caf6a46bef3880 Mon Sep 17 00:00:00 2001 From: Milo Kerr Date: Thu, 25 Mar 2021 01:45:43 -0400 Subject: Update use of HTTP to HTTPS in esri plugin When accessed via HTTP, the arcgis.com endpoints return: {"error":{"code":400,"message":"HTTP not supported","details":[]}} With this change the esri plugin now accesses them via HTTPS. [ChangeLog][plugins][esri] Pick-to: 5.15 Fixes: QTBUG-92111 Change-Id: I7be0295f8c65853ab214bc11d7e6008f3137403a Reviewed-by: Qt CI Bot Reviewed-by: Alex Blasche Reviewed-by: Guillaume Belz --- .../esri/geocodingmanagerengine_esri.cpp | 6 ++- .../geoservices/esri/georoutejsonparser_esri.cpp | 3 +- .../geoservices/esri/georoutereply_esri.cpp | 3 +- .../esri/georoutingmanagerengine_esri.cpp | 8 ++-- .../esri/geotiledmappingmanagerengine_esri.cpp | 3 +- src/plugins/geoservices/esri/maps.json | 48 +++++++++++----------- .../geoservices/esri/placemanagerengine_esri.cpp | 6 ++- 7 files changed, 43 insertions(+), 34 deletions(-) diff --git a/src/plugins/geoservices/esri/geocodingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/geocodingmanagerengine_esri.cpp index 5a40467e..d123c6a8 100644 --- a/src/plugins/geoservices/esri/geocodingmanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/geocodingmanagerengine_esri.cpp @@ -59,8 +59,10 @@ QT_BEGIN_NAMESPACE static const QString kPrefixEsri(QStringLiteral("esri.")); static const QString kParamUserAgent(kPrefixEsri + QStringLiteral("useragent")); -static const QString kUrlGeocode(QStringLiteral("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates")); -static const QString kUrlReverseGeocode(QStringLiteral("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode")); +static const QString kUrlGeocode(QStringLiteral("https://geocode.arcgis.com/arcgis/rest/services/" + "World/GeocodeServer/findAddressCandidates")); +static const QString kUrlReverseGeocode(QStringLiteral( + "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode")); static QString addressToQuery(const QGeoAddress &address) { diff --git a/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp b/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp index a9bbd35c..34d877df 100644 --- a/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp +++ b/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp @@ -46,7 +46,8 @@ QT_BEGIN_NAMESPACE -// JSON reference: http://resources.arcgis.com/en/help/arcgis-rest-api/#/Route_service_with_synchronous_execution/02r300000036000000/ +// JSON reference: +// https://resources.arcgis.com/en/help/arcgis-rest-api/#/Route_service_with_synchronous_execution/02r300000036000000/ static const QString kErrorMessage(QStringLiteral("Error %1: %2.")); static const QString kErrorJson(QStringLiteral("Error: invalide JSON document.")); diff --git a/src/plugins/geoservices/esri/georoutereply_esri.cpp b/src/plugins/geoservices/esri/georoutereply_esri.cpp index 8cadfb29..92b6bb13 100644 --- a/src/plugins/geoservices/esri/georoutereply_esri.cpp +++ b/src/plugins/geoservices/esri/georoutereply_esri.cpp @@ -44,7 +44,8 @@ QT_BEGIN_NAMESPACE -// JSON reference: http://resources.arcgis.com/en/help/arcgis-rest-api/#/Route_service_with_synchronous_execution/02r300000036000000/ +// JSON reference: +// https://resources.arcgis.com/en/help/arcgis-rest-api/#/Route_service_with_synchronous_execution/02r300000036000000/ GeoRouteReplyEsri::GeoRouteReplyEsri(QNetworkReply *reply, const QGeoRouteRequest &request, QObject *parent) : diff --git a/src/plugins/geoservices/esri/georoutingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/georoutingmanagerengine_esri.cpp index 0e6bc2c7..ed613f4b 100644 --- a/src/plugins/geoservices/esri/georoutingmanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/georoutingmanagerengine_esri.cpp @@ -48,7 +48,8 @@ static const QString kPrefixEsri(QStringLiteral("esri.")); static const QString kParamUserAgent(kPrefixEsri + QStringLiteral("useragent")); static const QString kParamToken(kPrefixEsri + QStringLiteral("token")); -static const QString kUrlRouting(QStringLiteral("http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve")); +static const QString kUrlRouting(QStringLiteral( + "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve")); GeoRoutingManagerEngineEsri::GeoRoutingManagerEngineEsri(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, @@ -70,7 +71,8 @@ GeoRoutingManagerEngineEsri::~GeoRoutingManagerEngineEsri() { } -// REST reference: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r300000036000000 +// REST reference: +// https://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r300000036000000 QGeoRouteReply *GeoRoutingManagerEngineEsri::calculateRoute(const QGeoRouteRequest &request) { @@ -125,7 +127,7 @@ void GeoRoutingManagerEngineEsri::replyError(QGeoRouteReply::Error errorCode, co QString GeoRoutingManagerEngineEsri::preferedDirectionLangage() { // list of supported langages is defined in: - // http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r300000036000000 + // https://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r300000036000000 const QStringList supportedLanguages = { "ar", // Generate directions in Arabic "cs", // Generate directions in Czech diff --git a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp index db75619e..c5845848 100644 --- a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp @@ -230,7 +230,8 @@ QGeoMap *GeoTiledMappingManagerEngineEsri::createMap() // ${y} = Y // ${token} = Token -// template = 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{{z}}/{{y}}/{{x}}.png' +// template = +// 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{{z}}/{{y}}/{{x}}.png' bool GeoTiledMappingManagerEngineEsri::initializeMapSources(QGeoServiceProvider::Error *error, QString *errorString, diff --git a/src/plugins/geoservices/esri/maps.json b/src/plugins/geoservices/esri/maps.json index 8167ae7d..862e087d 100644 --- a/src/plugins/geoservices/esri/maps.json +++ b/src/plugins/geoservices/esri/maps.json @@ -6,8 +6,8 @@ "description": "ArcGIS Online World Street Map", "mobile": true, "night": false, - "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -16,8 +16,8 @@ "": "ArcGIS Online World Imagery", "mobile": true, "night": false, - "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -26,8 +26,8 @@ "description": "ArcGIS Online World Terrain Base", "mobile": false, "night": false, - "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -36,8 +36,8 @@ "description": "ArcGIS Online World Topography", "mobile": true, "night": false, - "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -46,8 +46,8 @@ "description": "This map presents land cover and detailed topographic maps for the United States.", "mobile": true, "night": false, - "url": "http://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -56,8 +56,8 @@ "description": "National Geographic World Map", "mobile": false, "night": false, - "url": "http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -66,8 +66,8 @@ "description": "Thematic content providing a neutral background with minimal colors", "mobile": true, "night": false, - "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -76,8 +76,8 @@ "description": "Natural Earth physical map for the world", "mobile": false, "night": false, - "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -86,8 +86,8 @@ "description": "Portrays surface elevation as shaded relief", "mobile": false, "night": false, - "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -96,8 +96,8 @@ "description": "This map is designed to be used as a basemap by marine GIS professionals and as a reference map by anyone interested in ocean data", "mobile": false, "night": false, - "url": "http://server.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://server.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -106,8 +106,8 @@ "description": "Thematic content providing a neutral background with minimal colors", "mobile": false, "night": true, - "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer", + "copyrightText": "© Esri contributors" }, { @@ -116,8 +116,8 @@ "description": "DeLorme’s topographic basemap is a seamless global data set that portrays transportation, hydrography, jurisdiction boundaries, and major geographic features", "mobile": false, "night": false, - "url": "http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer", - "copyrightText": "© Esri contributors" + "url": "https://server.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer", + "copyrightText": "© Esri contributors" } ] } diff --git a/src/plugins/geoservices/esri/placemanagerengine_esri.cpp b/src/plugins/geoservices/esri/placemanagerengine_esri.cpp index 4152a268..8f1e7dbc 100644 --- a/src/plugins/geoservices/esri/placemanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/placemanagerengine_esri.cpp @@ -63,8 +63,10 @@ static const QString kCountriesKey(QStringLiteral("detailedCountries")); static const QString kLocalizedNamesKey(QStringLiteral("localizedNames")); static const QString kMaxLocationsKey(QStringLiteral("maxLocations")); -static const QUrl kUrlGeocodeServer("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer?f=pjson"); -static const QUrl kUrlFindAddressCandidates("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates"); +static const QUrl kUrlGeocodeServer( + "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer?f=pjson"); +static const QUrl kUrlFindAddressCandidates("https://geocode.arcgis.com/arcgis/rest/services/World/" + "GeocodeServer/findAddressCandidates"); PlaceManagerEngineEsri::PlaceManagerEngineEsri(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) : -- cgit v1.2.1