I thought again about it… I guess you are concerned because the body of all POST or PUT requests would be parsed. Of course this is bad! ☺ I think we have to check the value of the Content-Type header.
This is what we get from Micro Ocean: Content-Type: application/x-www-form-urlencoded Would it be ok to test this header before calling parse_cgivars() to parse the body? Do you have another idea? Regards, Franck From: devel <[email protected]> On Behalf Of Lamasuta, Franck, Vodafone Automotive Sent: jeudi 11 juillet 2019 12:06 To: Alexander Malysh <[email protected]> Cc: [email protected] Subject: RE: [PATCH] http PUT requests Hi Alexander, This is what http_accept_request() logs (with my patch) when Micro Ocean submits a DLR: 2019-07-10 13:21:05 [5746] [7] DEBUG: HTTP: Got PUT request with url='/MOcean-Kannel/DLR' and body='mocean-from=33123456789&mocean-to=Mocean&mocean-dlr-status=1&mocean-msgid=0710212043806340&mocean-error-code=0' As you can see, the query variables are in the body of the request. I think this is usual for a PUT (and for a POST). To avoid code duplication, it seemed logical to slightly modify parse_cgivars() to parse the body. How would you manage this? Regards, Franck From: Alexander Malysh <[email protected]<mailto:[email protected]>> On Behalf Of Alexander Malysh Sent: mardi 9 juillet 2019 08:42 To: Lamasuta, Franck, Vodafone Automotive <[email protected]<mailto:[email protected]>> Cc: [email protected]<mailto:[email protected]> Subject: Re: [PATCH] http PUT requests Hi, sorry for delay. Patch would be ok if not this part where you parse body for post and put request as cgi vars. this is wrong. Please fix it and resubmit. Thanks, Alexander Malysh Am 28.06.2019 um 10:58 schrieb Lamasuta, Franck, Vodafone Automotive <[email protected]<mailto:[email protected]>>: Hi list, Here is a patch to allow inbound http PUT requests in generic http connector. It is required to implement Micro Ocean’s API for Delivery Reports: https://www.moceanapi.com/docs/#delivery-report Regards, Franck <http_put.patch>
