qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.66k stars 3.01k forks source link

Unable to load images from World Imagery Wayback due to wrong redirected tile url #54161

Open liuxsdev opened 1 year ago

liuxsdev commented 1 year ago

What is the bug or the crash?

I found some World Imagery Wayback can not load correctly, because of redirected tile url, like #53792

Steps to reproduce the issue

  1. Add World Imagery Wayback WMTS link

https://wayback.maptiles.arcgis.com/arcgis/rest/services/world_imagery/mapserver/wmts/1.0.0/wmtscapabilities.xml image

  1. Add layer: World Imagery (Wayback 2023-06-29)

    no image shows, the debug tools shows tile url is wrong: image

  2. some image layer can be loaded successfully. such as World Imagery (Wayback 2014-02-20)

    image

I found some tile url will redirect to another url ,qgis does not add https://wayback.maptiles.arcgis.com/ to redirected url image

Versions

QGIS version 3.32.1-Lima QGIS code revision 4a078ecf63 Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.7.1 PROJ version 9.2.1 EPSG Registry database version v10.088 (2023-05-13) GEOS version 3.12.0-CAPI-1.18.0 SQLite version 3.41.1 PDAL version 2.5.5 PostgreSQL client version 15.2 SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009

Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99

Supported QGIS version

New profile

Additional context

No response

cody-somerville commented 1 year ago

It appears that the automatic following of the redirected request is not being handled according to RFC9110. I can confirm this issue is present in 3.32.3-Lima.

Section 10.2.2 Location

The field value consists of a single URI-reference. When it has the form of a relative reference ([URI], Section 4.2), the final value is computed by resolving it against the target URI ([URI], Section 5).

Section 15.4 Redirection 3xx

When automatically following a redirected request, the user agent SHOULD resend the original request message with the following modifications:

  1. Replace the target URI with the URI referenced by the redirection response's Location header field value after resolving it relative to the original request's target URI.