transfer-encoding and content-length header parsing conflict
- Lingua principale
- C++
- Stelle
- 4.8k
- Fork
- 694
- Merge medio
- 12h 48m
- PR unite (30g)
- 1
Descrizione
I've found an annoying bug in beast http client when handling chunked encoding...
Some servers send both content-length and transfer-encoding: chunked
Currently beast raises an error if both headers are present.
https://greenbytes.de/tech/webdav/rfc2616.html#message.length
> 1. If a Content-Length header field (Section 14.13) is present, its decimal value in OCTETs represents both the entity-length and the transfer-length. The Content-Length header field MUST NOT be sent if these two lengths are different (i.e., if a Transfer-Encoding header field is present). If a message is received with both a Transfer-Encoding header field and a Content-Length header field, the latter MUST be ignored.
https://github.com/boostorg/beast/blob/d1dabebd8352ce0e854474837ed11a27cb688edc/include/boost/beast/http/impl/basic_parser.ipp#L794-L799
https://github.com/boostorg/beast/blob/d1dabebd8352ce0e854474837ed11a27cb688edc/include/boost/beast/http/impl/basic_parser.ipp#L825-L830
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.