Closed akrieg-ionos closed 9 months ago
how are you setting content length? https://pkg.go.dev/net/http#Header documents the expected storage case, while the methods accept case insensitive input and convert accordingly.
I'll say I noticed header-keys are case intensive as well... - I even wrote some tests to validate it :)
I will try to proof my hypothesis with a test. If I fail, I will close this issue.
@akrieg-ionos pretty sure any keys in header
at that point would have been canonicalized:
@danp @seankhliao @jeeftor indeed i am wrong with my hypothesis, so i close this. Sorry for the noise and thanks for the feedback. :bouquet:
Go version
go version go1.22.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I want to use
response.ContentLength
attribute.What did you see happen?
If the response header has e.g. the key
content-length
response.ContentLength is not set as only "Content-Length" is taken into account.What did you expect to see?
However afaik header keys are case insensitive. So, if a response contains
Content-Length
or e.g.content-length
as header should make no difference regarding theresponse.ContentLength
attribute.