Bug report #13991
QGIS Server WFS GetFeature returns wrong content-length header
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | QGIS Server | ||
Affected QGIS version: | 2.12.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 22005 |
Description
GetFeature returns a content-length header which does not include the length of the content returned after the '<wfs:FeatureCollection>'-element.
Some clients dont accept content beyond the content-length and these clients will hence see an empty (and malformed) FeatureCollection.
This may relate to #13182
Example executing qgs_server from cli:
~/qgis-install/QGIS.app/Contents/MacOS/fcgi-bin $ QUERY_STRING="map=/Users/asger/Code/QGIS-server-content-length/qgis-server-content-length.qgs&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=data&SRSNAME=EPSG:4326&BBOX=-90,-90,90,90" ./qgis_mapserv.fcgi QFSFileEngine::open: No file name specified Content-Length: 542 Content-Type: text/xml; charset=utf-8 <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:qgs="http://www.qgis.org/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd http://www.qgis.org/gml http:?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=data&OUTPUTFORMAT=XMLSCHEMA"><gml:boundedBy> <gml:Box srsName="EPSG:4326"> <gml:coordinates cs="," ts=" ">-90,-90 90,90</gml:coordinates> </gml:Box> </gml:boundedBy> <gml:featureMember> <qgs:data fid="data.1"> <gml:boundedBy> <gml:Box srsName="EPSG:4326"> <gml:coordinates cs="," ts=" ">9.42827861,56.29949833 9.42827861,56.29949833</gml:coordinates> </gml:Box> </gml:boundedBy> <qgs:geometry> <gml:Point srsName="EPSG:4326"> <gml:coordinates cs="," ts=" ">9.42827861,56.29949833</gml:coordinates> </gml:Point> </qgs:geometry> <qgs:datafield>Data</qgs:datafield> </qgs:data> </gml:featureMember> <gml:featureMember> <qgs:data fid="data.2"> <gml:boundedBy> <gml:Box srsName="EPSG:4326"> <gml:coordinates cs="," ts=" ">11.78754779,55.52618232 11.78754779,55.52618232</gml:coordinates> </gml:Box> </gml:boundedBy> <qgs:geometry> <gml:Point srsName="EPSG:4326"> <gml:coordinates cs="," ts=" ">11.78754779,55.52618232</gml:coordinates> </gml:Point> </qgs:geometry> <qgs:datafield>Nodata</qgs:datafield> </qgs:data> </gml:featureMember> </wfs:FeatureCollection>
Note that the content-length is set to 542 bytes!
Associated revisions
History
#1 Updated by asgerpetersen - almost 9 years ago
Pull request https://github.com/qgis/QGIS/pull/2582 fixes the problem. https://github.com/qgis/QGIS/pull/2583 tests it.
#2 Updated by René-Luc ReLuc almost 9 years ago
- Status changed from Open to Closed
Fixed in changeset a37ca2b52fec4752c6345760cbe0e3c62861c2ce.