Open obatysh opened 5 years ago
RFC https://tools.ietf.org/html/rfc7230#page-31 says that duplicate Content-Length fields with the same decimal value can be either rejected as invalid or accepted by replacing duplicate with a single valid Content-Length field. So, it is not a violation, it is one of the possible options. Not sure about "replacement" implementation, maybe this pull-request should be improved not to report the Content-Length field second time.
Good point!
I'd love to hear opinion of @nodejs/http on that? Would we prefer to reject it or parse it?
it's worth noting that this costs an additional 8 bytes per struct http_parser
Yes. That means it breaks ABI and can't land in a v2.x release. See discussion in #435.
Hello!
Thank you for submitting this patch. Wouldn't allowing duplicate content-length header be a violation of protocol specification?