-
Notifications
You must be signed in to change notification settings - Fork 2k
Regular handling of bad URIs #14011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regular handling of bad URIs #14011
Conversation
Remove the differences in how bad URI are handled.
|
test failures here .
|
|
@gregw IMO those are just bad test cases. They only assert for 200 OK. |
The problem is a bit deeper than that. The client is allowing an authority to be passed as a URI. Now we are stricter in the URI parsing that fails. I have to investigate why it passed before. |
Remove the differences in how bad URI are handled.
joakime
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a small question that I think I know the answer to, just wanted to confirm with you first.
| _host = uri.substring(mark, i); | ||
| i++; | ||
| String host = uri.substring(mark, i); | ||
| URIUtil.validateInetAddress(host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this only occur during a detected IPLiteral only? not a hostname right?
If it's a hostname, the resulting call to InetAddress.getByName will incur a DNS hit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. IPV6 state is only entered after seeing the corresponding [ in HOST state. The state machine here is not as refined as in 12, so there are probably still a few more strange cases here.... but I don't want to substantively change the behavior.
Remove the differences in how bad URI are handled.