You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Content-Length being set through either of the following ways does not reflect on the response seen on the wire when executed from the handler of an HTTP HEAD request.
Send an HTTP HEAD request to http://localhost:8080/hello/world and notice that the Content-Length header in response is 0.
Notice this bug does not happen with HttpListenerMode.Microsoft.
Expected behavior Content-Length should have the value assigned to it
Screenshots
Desktop (please complete the following information):
OS: Windows
Browser: Fiddler
Additional context
EmbedIO's built in default logger will correctly show the Content-Length in the log, but the value sent is wrong.
Something else to consider is that while calling SetLength on the response output stream throws an error (caught by EmbedIO), the value sent on the wire for Content-Length becomes correct. My guess is that it's a side-effect of the exception being thrown (which is expected).
Furthermore, EmbedIO should probably forbid operating on Response.OutputStream altogether from a HEAD request, since clients are expected to ignore the body of HEAD replies.
The text was updated successfully, but these errors were encountered:
Describe the bug
Content-Length being set through either of the following ways does not reflect on the response seen on the wire when executed from the handler of an HTTP HEAD request.
To Reproduce
Steps to reproduce the behavior:
HEAD
request tohttp://localhost:8080/hello/world
and notice that theContent-Length
header in response is 0.HttpListenerMode.Microsoft
.Expected behavior
Content-Length
should have the value assigned to itScreenshots
Desktop (please complete the following information):
Additional context
EmbedIO's built in default logger will correctly show the Content-Length in the log, but the value sent is wrong.
Something else to consider is that while calling SetLength on the response output stream throws an error (caught by EmbedIO), the value sent on the wire for Content-Length becomes correct. My guess is that it's a side-effect of the exception being thrown (which is expected).
Furthermore, EmbedIO should probably forbid operating on Response.OutputStream altogether from a HEAD request, since clients are expected to ignore the body of HEAD replies.
The text was updated successfully, but these errors were encountered: