NanoHttpd / nanohttpd

Tiny, easily embeddable HTTP server in Java.
http://nanohttpd.org
BSD 3-Clause "New" or "Revised" License
6.89k stars 1.69k forks source link

postData still contains the chunksize #617

Open StefanLobbenmeier opened 2 years ago

StefanLobbenmeier commented 2 years ago

This might also be described in #293, but since that author did not provide as much detail I am creating a new issue.

My client is sending some xml data via a chunked HTTP message, see this screenshot from wireshark: image

Now when I access the field postData in my server code I get this:

25e
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><--censored payload--></soapenv:Body></soapenv:Envelope>
0

As you can see, the chunksize before the XML is also contained in the postData: image

The last 0 is another chunk of size zero, not sure why it is being sent: image

I would expect the HTTP Server to unwrap the data instead of having to do that myself.

StefanLobbenmeier commented 2 years ago

This is not a blocking issue for me, I just wanted to report it so it can be used as a reference. I wanted to use NanoHttpd as a reverse Proxy but ended up going with undertow instead since it has reverse proxy functionality built-in