Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
event subscription
29-03-2017, 11:52 AM
Post: #1
event subscription

I think i found a small bug in event subscription.

When subscribing to events openhome player defaults to sending data chunked. In event header 'transfer-encoding' ist set to 'chunked' and chunk length is specified before chunk starts.

When subscribing to events using http 1.0 protocol version chunked encoding is not allowed. According to that openhome player does not send the data chunked anymore but mandatory header 'content-length' is missing.

Maybe you could check that out. Don't know if it's worth bugfixing this since most tools default to http 1.1.

Best regards
Find all posts by this user
31-03-2017, 02:28 PM
Post: #2
RE: event subscription
This behaviour is deliberate and (I think) allowed. From rfc1945 (my emphasis)

Quote:7.2.2 Length

When an Entity-Body is included with a message, the length of that
body may be determined in one of two ways. If a Content-Length header
field is present, its value in bytes represents the length of the
Entity-Body. Otherwise, the body length is determined by the closing
of the connection by the server.

Closing the connection cannot be used to indicate the end of a
request body, since it leaves no possibility for the server to send
back a response. Therefore, HTTP/1.0 requests containing an entity
body must include a valid Content-Length header field. If a request
contains an entity body and Content-Length is not specified, and the
server does not recognize or cannot calculate the length from other
fields, then the server should send a 400 (bad request) response.

I read this as saying it is valid for ohPlayer's HTTP server to omit the Content-Length header, write an entity body in its response then close the connection.

If you still feel this is a bug, can you point me to the relevant section of the spec please?
Find all posts by this user

Forum Jump: