-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Does the WireMock send Content-Length response header #136
Comments
For now I ignore these restricted headers in WireMock.Net:
See also https://msdn.microsoft.com/en-us/library/78h415ay(v=vs.110).aspx Did you check the original java implementation from WireMock to see if this is possible there? |
I haven't checked the Java implementation, so I don't know if it's possible there.
But in my example, I attempt to set the The purpose of WireMock is to allow people to mock service responses, therefore, in my opinion, it's fair to expect that the library allows building a response with any kind of content. Another thing which I have noticed inspecting the internals of I also think that if WireMock has its own ideas about allowed and not allowed request and response headers, their content and their combinations, the server should crash in the case when the inconsistency is detected instead of silently ignoring it. If we get back to my example: when you read the |
You are correct. I think that I switched Request en Response headers in my implementation. I had some troubles some time ago when setting the I will check that code again, and keep you informed. |
I've created a PR : you take a look and review this : #142 |
Solved, see NuGet 1.0.3.18 |
Hello,
I need to make a response mock with a specific value of
Content-Length
header:Unfortunately the Assert fails and the
Content-Length
is not part ofresponse.Content.Headers
.I suspect problem might be in the fact that the server by default assigns header
Transfer-Encoding: chunked
.According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding
I was not able to assign my own
Transfer-Encoding: identity
. I will create a separate question about it.WireMock.Net version
1.0.3.16
.The text was updated successfully, but these errors were encountered: