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.09k stars 2.93k forks source link

WMS/WFS http headers not saved #57499

Closed nicogodet closed 1 month ago

nicogodet commented 1 month ago

What is the bug or the crash?

A WMS connection is set with a http header image

After closing and reopening QGIS, header is gone.

Steps to reproduce the issue

  1. Create new WMS connection
  2. URL : https://data.geopf.fr/private/wms-r?VERSION=1.3.0
  3. In HTTP headers, advanced, add new key : apikey with value ign_scan_ws
  4. Connect and you can add a layer.
  5. Close QGIS
  6. Open QGIS
  7. Try to connect to previouly added connection
  8. Error
  9. If you edit, you can see header is gone.

Versions

3.36.3

Supported QGIS version

New profile

Additional context

No response

nicogodet commented 1 month ago

I believed it used to work in previous version (maybe before the whole refactoring of settings).

elpaso commented 1 month ago

CC @3nids

3nids commented 1 month ago

I just tried it using WMS. The headers are part of the request:

image

But it might be an issue of settings migration. It could be that you defined this in older version and it doesn't work in a recent one or vice-versa. Could you confirm a path to reproduce?

nicogodet commented 1 month ago

If headers are set during current QGIS session, no issue. This is not the issue I described in first post.

The issue occurs if you exit and restart QGIS. Previously added WMS layers still have headers in URI. But if you try to connect to WMS server to add another layer, there is an error. Edit connection and see headers are missing.

Steps provided in first post reproduce the issue on fresh profile.

3nids commented 1 month ago

After closing and reopening, I do see the header in the config and it's added to the new connection. Tried both from add layer and browser.

I suspect there is something wrong with backward compatibility. I've spotted this: https://github.com/qgis/QGIS/pull/57585

I hope it solves this scenario (which is probably yours):

nicogodet commented 1 month ago

@3nids You tried on master ? I tired on both 3.34 and 3.36 with a new profile and I have the described issue with both. I will retry to be sure...

3nids commented 1 month ago

yes master, but I realize that the pre 3.30 should not affect the scenario I described....

do you have a chance to check with and without the related fix?

nicogodet commented 1 month ago

QGIS3.ini after QGIS is closed image

QGIS3.ini after I opened it image

on fresh profile.

I will try the windows build once it's done ;)

EDIT : Same behavior with proposed PR