Bug report #13991

QGIS Server WFS GetFeature returns wrong content-length header

Added by asgerpetersen - almost 9 years ago. Updated almost 9 years ago.

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&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=data&amp;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

Revision a37ca2b5
Added by René-Luc ReLuc almost 9 years ago

Dont set content-length header on streamed response. Fixes #13991

Thanks to @AsgerPetersen to help fixing #13991
closes #2582

Revision 6abb99b1
Added by René-Luc ReLuc almost 9 years ago

Dont set content-length header on streamed response. Fixes #13991

Thanks to @AsgerPetersen to help fixing #13991
closes #2582

Revision 52f6b73b
Added by René-Luc ReLuc almost 9 years ago

Dont set content-length header on streamed response. Fixes #13991

Thanks to @AsgerPetersen to help fixing #13991
closes #2582

Revision 1a223bfb
Added by René-Luc ReLuc almost 9 years ago

Dont set content-length header on streamed response. Fixes #13991

Thanks to @AsgerPetersen to help fixing #13991
closes #2582

History

#2 Updated by René-Luc ReLuc almost 9 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF