Bug report #21380

WFS GET requests default to using "hostname:80' in the host header instead of just "hostname"

Added by Lilah R about 5 years ago. Updated about 5 years ago.

Category:Web Services clients/WFS
Affected QGIS version:3.6.0 Regression?:No
Operating System:Windows Easy fix?:Yes
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:29197


I spent the evening trying to figure out why the Lazio regional WFS server (http://geoportale.regione.lazio.it/geoserver_nsit/wfs) was throwing a 403 forbidden error whenever I tried to connect via QGIS, but responding normally when I tried to connect to it in any other way. It turns out that QGIS adds a :80 to the hostname of a server, and that this particular WFS server refuses connections that include the port number in the header. I don't know why this would be, but it's pretty unusual. Neither Firefox nor WGET add :80 to the HOST line in their HTTP GET requests. Ideally, QGIS would default to not including the port number and assuming the server will default to port 80, but if that would break things, then perhaps at least there could be an override option to send a GET request without including the port number.


#1 Updated by Alessandro Pasotti about 5 years ago

  • Resolution set to invalid
  • Status changed from Open to Rejected

QGIS honours the capabilities sent by the server:


<ows:Get xlink:href="http://geoportale.regione.lazio.it:80/geoserver_nsit/wfs"/>

#2 Updated by Andrea Giudiceandrea about 5 years ago

Lilah R, you can override the "wrong" GetMap URI provided in the capabilities, using the option "Ignore GetMap/GetTile URI reported in capabilities" (and "Ignore GetFeatureInfo URI reported in capabilities" if needed) in the "WMS/WMTS Options" section of the "Create a New WMS/WMTS Connection" dialog window.
See also http://osgeo-org.1560.x6.nabble.com/Servizio-WMS-del-SIT-Regione-Lazio-su-QGIS-Considerazioni-varie-td5399043.html for the same problem with the geoportale.regione.lazio.it WMS.

#3 Updated by Alessandro Pasotti about 5 years ago

Wasn't this issue for WFS?

#4 Updated by Andrea Giudiceandrea about 5 years ago

You are right Alessandro, I got confused...

So it seems the WFS connection manager lacks an option to override the (GetFeature, DescribeFeatureType, ...) URIs reported in capabilities, while WMS/WMTS and WCS connection managers have that option ("Ignore GetMap/GetTile URI reported in capabilities"/"Ignore GetFeatureInfo URI reported in capabilities" for WMS/WMST and "Ignore GetCoverage URI reported in capabilities" for WCS).

It's the opposite of Bug reports #18099 and #16173 that you fixed for QGIS 3 with PR https://github.com/qgis/QGIS/pull/6407

In fact, with QGIS 2.18 the WFS at http://geoportale.regione.lazio.it/geoserver_nsit/wfs works without throwing the 403 forbidden error.

It would be nice to have a DCP override option for WFS too. This could be a feature request...

Also available in: Atom PDF