-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix header .Add functions #1036
Conversation
These functions should take the headers that are handled differently into account.
LGTM! |
Nice catch! Lgtm |
old code: case HeaderTransferEncoding:
// Transfer-Encoding is managed automatically.
case HeaderDate:
// Date is managed automatically.
default:
h.h = setArgBytes(h.h, key, value, argsHasValue) new code: case 't':
if caseInsensitiveCompare(strTransferEncoding, key) {
// Transfer-Encoding is managed automatically.
return true
}
.....
case 'd':
if caseInsensitiveCompare(strDate, key) {
// Date is managed automatically.
return true
}
}
.... @erikdubbelboer and if we don't change the return value, we have to set it inside, because somewhere the header value should be set also think you should rebuild the adjustment with the encoding in the adapter test, because exactly that would have shown you this error Line 1252 in 7bd43f6
Line 1296 in 7bd43f6
i saw this, because of our tests we expect |
To be honest I think your test is wrong. |
ok, thanks then I will adjust our tests times, just wanted to be sure you had that also in your tests and I thought it should be settable thx |
These functions should take the headers that are handled differently into account.
Fixes #1033
After this change it is not possible to have multiple
Content-Type, Content-Length, Connection, Server, Set-Cookie, Transfer-Encoding and Date headers. Having other headers multiple times is still fine. For these headers it should never happen anyways and I don't think we have any users who do this. But if they do it would break for then.