Closed Flow86 closed 3 years ago
Do you mind pointing to which section in the HTTP 1.1 RFCs you're looking at? I'm looking at section 3.3.2 of RFC7230 and there are a lot of optional things you can do with Content-Length, but the only mandatory thing I see is when the body is empty, the header must be present with the value of 0.
Although in general, your branch looks good; I think it's very reasonable to expect a Content-Length header since it's a pretty trivial thing to support.
Do you mind pointing to which section in the HTTP 1.1 RFCs you're looking at? I'm looking at section 3.3.2 of RFC7230 and there are a lot of optional things you can do with Content-Length, but the only mandatory thing I see is when the body is empty, the header must be present with the value of 0.
I seem to have misread the rfc. It states only SHOULD
not MUST
. So without Content-Length
its quiet right. So probably I report it to Chilkat too ;-)
Thanks for confirming! Yes, please give this feedback to Chilkat, but we can accept your proposed change since it does add goodness to the server in an easy manner.
@Flow86 feel free to open a pull request from that branch you've made; we should be able to accept it formally later this week.
Hi,
I tried to use the Redfish-Mockup-Server with a mockup I created with Redfish-Mockup-Creator, but ran into some problems with my HTTP client by Chilkat (3rdparty library).
When trying to get a response from the mockup server, I succesfully retrieve the response but without body. Chilkat stopped reading the body after the headers since neither Transfer-Encoding nor Content-Length was specified.
As far as I understood the HTTP RFCs correctly (but I could be wrong of course!) - you either have to specify a
Content-Length
orTransfer-Encoding: chunked
for HTTP 1.1 responses?After quick&dirty hacking the Content-Length header in in "None-Headerfile-Response-Mode" it worked for me.
Can you add the Content-Length header for responses in general?