rootvector2 commented on PR #750:
URL: 
https://github.com/apache/httpcomponents-core/pull/750#issuecomment-7018678933

   `Long#parseLong` goes through `Character#digit`, so it takes any Unicode 
decimal digit and fullwidth `A`-`F`, not just `0-9`/`A-F`. That's only 
reachable when `CharCodingConfig` sets a non-Latin-1 charset like UTF-8. Then 
`Content-Length: ١٠` parses as 10, while a front-end that follows RFC 9112 
`1*DIGIT` rejects or ignores it, so the two disagree on where the body ends. I 
hit this going over the #729 parse sites and reproduced it on a 
`DefaultBHttpServerConnection` with a UTF-8 decoder, where the bytes of the 
next pipelined request got read as body. With the default config high bytes map 
to U+0080-U+00FF and none of those parse as digits, so default setups aren't 
affected.
   
   On cost, it's one pass over the same short string `Long#parseLong` already 
walks, once per message or chunk header. If guarding the UTF-8 case isn't worth 
it to you, I'm fine closing this.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to