Opened 6 years ago

Closed 6 years ago

#7141 closed defect (fixed)

CPLHTTPParseMultipartMime can't parse ArcGIS WCS 2.0.1 GetCoverage response

Reported by: Ari Jolma Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords: WCS driver
Cc:

Description

That function fails at the collect headers phase in CPLError when it hits the tiff content, which does not contain "\n". Looking at the message, it seems to me that its logic is: header lines start with "Content-" and end with "\n" and data parts end at "--wcs\n".

Attachments (1)

wcs-response (2.5 KB ) - added by Ari Jolma 6 years ago.

Download all attachments as: .zip

Change History (3)

by Ari Jolma, 6 years ago

Attachment: wcs-response added

comment:1 by Ari Jolma, 6 years ago

if( !STARTS_WITH(pszNext, "Content-") ) {
    break;
}

within the collect headers loop would fix this issue. But I have no idea about what it would do with other cases.

comment:2 by Even Rouault, 6 years ago

Resolution: fixed
Status: newclosed

Ari's above workaround has been fixed in r40919. I do believe that the ArcGIS output is non conformant with MIME multipart. EOL separator must be \r\n, and there must be an empty line between the headers and body. This workaround might be good enough for now, with the caveat that potential headers non starting with Content- will not be registered.

Note: See TracTickets for help on using tickets.