Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem when action request doesn't have Content-Length header
02-07-2013, 06:11 PM (This post was last modified: 02-07-2013 07:45 PM by simoncn.)
Post: #8
RE: Problem when action request doesn't have Content-Length header
(02-07-2013 07:53 AM)simonc Wrote:  Good point, I hadn't realised this was possible.

Please don't go to any effort confirming the exact nature of the original problem on my behalf. I had thought I could skip support for no Content-Length or chunking but I understand now that this is a valid CP behaviour. I'll add it in for the device stack server.

I've done some more research into this, and it seems your original impression is correct. See this page for the HTTP rules. Specifically:

The presence of a message-body in a request is signaled by the inclusion of a Content-Length or Transfer-Encoding header field in the request's message-headers. A message-body MUST NOT be included in a request if the specification of the request method (section 5.1.1) does not allow sending an entity-body in requests. A server SHOULD read and forward a message-body on any request; if the request method does not include defined semantics for an entity-body, then the message-body SHOULD be ignored when handling the request.

and:

5.By the server closing the connection. (Closing the connection cannot be used to indicate the end of a request body, since that would leave no possibility for the server to send back a response.)

This means the following section from page 75 of the UPnP Device Architecture 1.1 specification is wrong:

CONTENT-LENGTH
REQUIRED if Origin Server does not close the session after sending the action invocation AND Origin Server does not send the
action invocation using chunked encoding.
PROHIBITED if Origin Server sends the action invocation using chunked encoding. OPTIONAL otherwise.
Field value specifies the length of the body in bytes. Integer.


The reference to "Origin Server" provides a clue that this wording has been incorrectly copied and pasted from another section of the document that specifies the rules for HTTP responses (pages 65, 77, 81 and 99).
Find all posts by this user


Messages In This Thread
RE: Problem when action request doesn't have Content-Length header - simoncn - 02-07-2013 06:11 PM

Forum Jump: