CC: | lstein [...] cshl.edu |
Subject: | 400 Bad request (malformed multipart POST) with multipart/related |
Date: | Fri, 30 Nov 2007 17:20:18 +0100 |
To: | bug-CGI.pm [...] rt.cpan.org |
From: | Sebastiano Piccoli <sebastiano.piccoli [...] staff.dada.net> |
Hi,
since the version 3.27 it seems that a posted multipart/related data
generates the error:
400 Bad request (malformed multipart POST)
I have parsed the content with MIME::Parser and it's ok. It seems that
the function readHeader in read_multipart_related returns a void hash.
Below the POST (------=_Part_0.7772611529786723.1196412625897 is the
first line):
------=_Part_0.7772611529786723.1196412625897
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-ID: <mm7-submit>
<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<mm7:TransactionID env:mustUnderstand="1"
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0">4401196412625869430</mm7:TransactionID>
</env:Header>
<env:Body>
<mm7:CapabilityASReplyReq
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0">
<MM7Version>5.3.0</MM7Version>
<SenderAddress>XXXXX</SenderAddress>
<CapRequestId>4401196412625869430</CapRequestId>
<TimeStamp>2007-11-30 09:50:25</TimeStamp>
<StatusCode>1000</StatusCode>
<StatusText>Request Received</StatusText>
<Content href="cid:generic_content_id"/>
</mm7:CapabilityASReplyReq>
</env:Body>
</env:Envelope>
------=_Part_0.7772611529786723.1196412625897
Content-Type: application/x-zip; name=capabilities.zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=capabilities.zip
Content-ID: <capabilities.zip>
UEsDBBQACAAIA
------=_Part_0.7772611529786723.1196412625897--
and a bash script to post it:
**********************************************************
#!/bin/sh
lwp-request -m 'post' -c 'multipart/related;
boundary="----=_Part_0.7772611529786723.1196412625897"; type="text/xml";
start="cid:mm7-submit"' 'http://urltest.local.com/cgi-bin/my.cgi' < post.txt
**********************************************************
Just to version 3.25 the same content was pushed in POSTDATA.
Thanks
--
Sebastiano Piccoli
Software developer
Dada SpA
sebastiano.piccoli@staff.dada.net
http://www.dada.net/