Ticket #104 (accepted Enhancement)

Opened 3 years ago

Last modified 22 months ago

Add "Content-Lenght: 0" to 304 responses

Reported by: ibc Owned by: saul
Priority: Minor Milestone: Next Release
Component: Interoperability Version: trunk
Severity: Non-critical Keywords:
Cc:

Description

I've realized that OpenXCAP doesn't add "Content-Length: 0" when replies 304 (with no body). Sincerelly I'm not sure if Content-Length is required in HTTP even if content size is 0.

However I've detected some HTTP clients getting blocked for some seconds when receving such response, waiting for the body.

Most probably, this is a bug in the client but I suggest OpenXCAP to add "Content-Length: 0" even if body is empty.

Change History

comment:1 Changed 3 years ago by ibc

For sure this is a bug in Ruby httpclient:

RFC 2616:

4.4 Message Length

The transfer-length of a message is the length of the message-body as it appears in the message; that is, after any transfer-codings have been applied. When a message-body is included with a message, the transfer-length of that body is determined by one of the following (in order of precedence): 

1.Any response message which "MUST NOT" include a message-body (such as the 1xx, 204, and 304 responses and any response to a HEAD request) is always terminated by the first empty line after the header fields, regardless of the entity-header fields present in the message.

Anyhow, it would be nice if OpenXCAP adds "Content-Length: 0".

comment:2 Changed 3 years ago by adigeo

  • Owner changed from support@ag-projects.com to adigeo
  • Status changed from new to accepted
  • Milestone changed from OpenXCAP 1.2.0 to Nice to have

comment:3 Changed 2 years ago by saul

  • Owner changed from adigeo to saul
  • Version set to trunk
  • Type changed from Defect to Enhancement
  • Milestone changed from Nice to have to OpenXCAP 1.2.0

comment:4 Changed 22 months ago by saul

  • Milestone changed from OpenXCAP 1.2.0 to OpenXCAP 1.2.1
Note: See TracTickets for help on using tickets.