-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP referer ignored with XYZ Tiles connection #58252
Comments
@MatzFan, thanks for reporting. I cannot replicate the described behavior using QGIS 3.38.1 (OSGeo4W) on Windows 10:
|
No change with new profile, but I fixed it by removing the layer from my project and then adding it back. Referer header now present again. Perhaps the issue was caused by me upgrading from 3.22 to 3.38. I'll leave this open in case you want to investigate whether this is an upgrade problem, but otherwise I consider the issue resolved. Thanks for your help. |
The issue occurs when a project, created by QGIS 3.22 and containing an XYZ layer for which the "referer" HTTP header was set, is opened using QGIS >= 3.26.0 (QGIS 3.34.9 and QGIS 3.38.1 included): in such case the referer URL is not sent in the HTTP request to the XYZ server. Thus QGIS >= 3.26 cannot correctly read the referer URL set for an XYZ (maybe other ones?) layer contained in a QGIS 3.22 project. It seems to me the issue is due to the fact that in QGIS 3.22 the referer URL is added to the layer source as @benoitdm-oslandia, may this be due to #48578? |
Hi, I will have a look asap ;) |
@MatzFan can you provide both project files (in 3.22 and >=3.26)? |
@benoitdm-oslandia please find both the QGIS project created using QGIS 3.22.0 and the one created using QGIS 3.34.9 in the attached zip archive xyzreferer.zip. As you can see inspecting them, or even just looking at the Layer Properties / Information panel, the layer created using QGIS 3.22 has the referer stored in the layer's source as QGIS 3.22 recognises the referer opening either the project created using QGIS 3.22 or the project created using QGIS 3.34. It looks like that while QGIS 3.34 stores the referer in the layer source both as |
@benoitdm-oslandia do you still need project files from me? |
@MatzFan @agiudiceandrea I pushed a fix and if the CI works properly you could have a windows to test with! Regards. |
What is the bug or the crash?
I have an XYZ Tiles connection to an ArcGIS server which requires a referer header. Despite setting the referer in the relevant field it is ignored in HTTP requests made to the server. Consequently the tile service does not work as 403 errors result from all requests.
Note I have just upgraded from QGIS v3.22 and the referer header was respected in that version.
Steps to reproduce the issue
Set up an new XYZ Tiles connection as follows:-
Open the Debugging panel, select one of the failed HTTP requests and copy as cURL. Observer that the Accept and User-Agent headers are set, but not Referer. E.g:
curl 'https://gojdippmaps.azurewebsites.net/proxy.ashx?https://maps.gov.je/arcgis/rest/services/Basemaps/Jersey_Basemap_Colour_wgs84/MapServer/tile/12/1404/2027' -H 'Accept: */*' -H 'User-Agent: QGIS/33801/LMDE 6 (faye)' --compressed
Versions
<style type="text/css"> p, li { white-space: pre-wrap; } </style>Active Python plugins
grassprovider
2.12.99
db_manager
0.1.20
processing
2.12.99
MetaSearch
0.3.6
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: