carterkozak commented on pull request #279: URL: https://github.com/apache/httpcomponents-core/pull/279#issuecomment-814095507
> From my PoV the entire parsing logic is broken because it tries to read the port before host/IP literal. Such an approach does not handle corner cases This is correct, I updated the parsers to assume all ipv6 addresses are correctly bracketed, but I did not update them to fail if that is not the case. I think it's tricky because we don't have a specification for these, as they don't exactly match URIs. None of these classes handle percent-encoded hostnames either, but it's not clear if that should be considered part of the same bug (I can file something else for it depending how we want to move forward). > would be nice to have HC be the canonical code for URI parsing and generation. I would expect all that to take place in one location, at least under the covers. Host/HttpHost/URIAuthority don't appear to accept entire URIs, which means it may not be obvious that they should use URI bracket encoding for host/port separation, or that they must be strict about it. I'm all for reusing logic, but I'm worried that we'd inadvertently break edge cases on these other classes if we weren't careful. I agree that it's very strange these three classes are nearly equivalent in many ways, yet have different requirements. For example, Host requires a port and fails otherwise, but HttpHost uses default -1. -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
