NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.15k stars 1.47k forks source link

Content-Length not shown in Response Header when content is present. #2975

Open shaileshbc opened 5 years ago

shaileshbc commented 5 years ago

I am using Nancy as self Hosting. When Content is not present in response, it shows Content-length : "0" in Header, but when content is present and Content-Length parameter has been added into Header still in response it does not show Content Length following is the response

HTTP/1.1 200 OK Content-Type: application/octet-stream Server: Microsoft-HTTPAPI/2.0 response_code: OK cmd_id: 210 cmd_code: GET_USER_INFO Date: Sat, 17 Aug 2019 05:54:15 GMT Connection: close

....{"user_id":"A-0001 01"}.

where ....{"user_id":"A-0001 01"}. is being sent as binary format

where as when content is not present, response is as follows HTTP/1.1 200 OK Content-Type: application/octet-stream Server: Microsoft-HTTPAPI/2.0 response_code: OK cmd_id: 211 cmd_code: Date: Sat, 17 Aug 2019 06:08:34 GMT Connection: close Content-Length: 0

I am using Nancy 2.0.0, Nancy.Hosting.Self.2.0.0,

Can anybody let me know, why Content-length is not being sent in Response Header. regards Shailesh