Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem when action request doesn't have Content-Length header
30-06-2013, 08:34 PM
Post: #1
Problem when action request doesn't have Content-Length header
If a control point sends an HTTP POST action request without a Content-Length header, ohNet rejects it with a 400 Bad Request response.

According to the UPnP Device Architecture 1.1 specification, devices must support this if the POST request body is sent with chunked encoding or if the connection is closed after the POST request body has been sent.

I discovered this when investigating a bug report from a MinimServer user for an interoperability failure when using a control point that sends POST requests without a Content-Length header (Simaudio MOON MiND).

I'm atttaching a patch to DviServerUpnp.cpp and DviServerUpnp.h to fix this. The added code is similar to that used in ProtocolUpnp.cpp and XmlFetcher.cpp. The patch has been tested by the user and confirmed as fixing the reported interoperability issue. I've also scanned the rest of the ohNet code to verify that there aren't any more instances of this problem.


Attached File(s)
.zip  contentlength.zip (Size: 1.26 KB / Downloads: 4)
Find all posts by this user


Messages In This Thread
Problem when action request doesn't have Content-Length header - simoncn - 30-06-2013 08:34 PM

Forum Jump: