Skip to content

Conversation

@gregw
Copy link
Contributor

@gregw gregw commented Nov 10, 2025

Remove the differences in how bad URI are handled.

Remove the differences in how bad URI are handled.
@gregw gregw requested review from joakime and lorban November 10, 2025 21:16
@joakime
Copy link
Contributor

joakime commented Nov 10, 2025

test failures here .

  • org.eclipse.jetty.proxy.ForwardProxyTLSServerTest.testIPv6
  • org.eclipse.jetty.proxy.ForwardProxyTLSServerTest.testOneExchange

@joakime
Copy link
Contributor

joakime commented Nov 10, 2025

@gregw IMO those are just bad test cases.

They only assert for 200 OK.
Not that the proxy was used properly.

@gregw
Copy link
Contributor Author

gregw commented Nov 11, 2025

@gregw IMO those are just bad test cases.

They only assert for 200 OK. Not that the proxy was used properly.

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.
@gregw gregw requested a review from janbartel November 13, 2025 21:50
Copy link
Contributor

@joakime joakime left a 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);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@gregw gregw merged commit 89d2ac7 into jetty-9.4.x Nov 19, 2025
7 checks passed
@gregw gregw deleted the enhancement/jetty-9.4.x/regularBadUris branch November 19, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants