Closed FrancYescO closed 4 years ago
Too much parsing is done on the headers, this will cause losing white spaces between headers values when we build it back...
According to HTTP RFC spec leading and trailing spaces inside the header value must be omitted.
... and also, due to the fact that the (first-found) Host header is stripped out from the headers object array when the request is built back we lose the order (will be forcely moved to the second row)
Your message is incorrect. HttpZ uses the fist host
header to build model.host
field, and removes it from the headers list.
Yes but why host get removed from the headers as it still remain one of it ?
And you are right about the RFC, but as a parser library we should have a way to manage these strange behaviours
Yes but why host get removed from the headers as it still remain one of it ?
Because it's added in httpZ model.
Do you have a way to put it in the reconstructed header in the same order?
I don't see any benefit from duplicating host in two places.
The benefit was to have the headers (host) in the right order.
Take this example code:
Too much parsing is done on the headers, this will cause losing white spaces between headers values when we build it back and also, due to the fact that the (first-found)
Host
header is stripped out from the headers object array when the request is built back we lose the order (will be forcely moved to the second row)