mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Question: UsingHead always returns 0 for Content-Length header even when explicitly specified #92
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pm7y on GitHub (Apr 16, 2018).
Originally assigned to: @StefH on GitHub.
The response to a HEAD request should be the length of the file (without the actual body) so something like this (below) should return 1024 in the Content-Length response header but it always returns 0. Something internally must be overwriting my value of "1024" back to "0".
@StefH commented on GitHub (Apr 16, 2018):
This is a restricted header:
https://msdn.microsoft.com/en-us/library/78h415ay(v=vs.110).aspx
@StefH commented on GitHub (Apr 19, 2018):
@pmcilreavy Does this answer your question?
@StefH commented on GitHub (Apr 24, 2018):
Closing
@o7g8 commented on GitHub (May 16, 2018):
@StefH the documentation https://msdn.microsoft.com/en-us/library/78h415ay(v=vs.110).aspx says
But in this example the code attempts to set in the response.
Why shouldn't it be possible for a mock to specify an arbitrary value of
Content-Length?@StefH commented on GitHub (May 25, 2018):
Solved, see NuGet 1.0.3.18