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
Fix #6860 IPv6 Format #6861
Fix #6860 IPv6 Format #6861
Conversation
Fix #6860 IPv6 format by adding a per context configuration. Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@gregw I pushed a fix to this branch, it had about 60 checkstyle failures. |
jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
Outdated
Show resolved
Hide resolved
updates from review Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw this PR is missing tests, I fear that the "unchanged" semantic may not work as the field could already be set "normalized". |
unit test and fixes Signed-off-by: Greg Wilkins <gregw@webtide.com>
fix style Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw this still doesn't work too well with
|
@lachlan-roberts I'm open to suggestions? But I'm not sure that 1:2:3:4:5:6:7:8:8080 is really ever valid? |
So 9.3 just assumed that the last : always indicated a port. I think this was a bad/wrong/dangerous thing. So I'm not sure we should be bug for bug compatible with that. |
That's fine. But I think the main issue is that |
Which is why we have the UNBRACKETED option. I don't think we can do anything else as this is a per webapp setting and the customizer is run before the webapp is known. |
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Both @lachlan-roberts and I were not totally happy that UNCHANGED didn't really work as we frequently normalize elsewhere. So instead of introducing new forever public configuration, this change now is the minimal that we can do to make the formatting in an easily extensible class for the sponsor. @sbordet please re-review. |
@gregw this PR has failures in
|
Signed-off-by: Greg Wilkins <gregw@webtide.com>
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.
LGTM apart a glitch in Request.formatAddrOrHost()
.
|
||
private String formatAddrOrHost(String name) | ||
{ | ||
return _channel == null ? HostPort.normalizeHost(name) : _channel.formatAddrOrHost(name); |
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.
_channel
is a final
field. Can it ever be null
?
If it is only null
in tests, you may want to add a comment about that.
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.
It should only be null in tests, but we have a specific test to check it works with null.
Fix #6860 IPv6 format by adding an extensible HttpChannel method Signed-off-by: Greg Wilkins <gregw@webtide.com> Co-authored-by: Lachlan Roberts <lachlan@webtide.com> Signed-off-by: Greg Wilkins <gregw@webtide.com> # Conflicts: # jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java # jetty-server/src/main/java/org/eclipse/jetty/server/Request.java # jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java # jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java
Fix #6860 IPv6 format by adding an extensible HttpChannel method Signed-off-by: Greg Wilkins <gregw@webtide.com> Co-authored-by: Lachlan Roberts <lachlan@webtide.com> Signed-off-by: Greg Wilkins <gregw@webtide.com> # Conflicts: # jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java # jetty-server/src/main/java/org/eclipse/jetty/server/Request.java # jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java # jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java
Fix #6860 IPv6 format by adding an extensible HttpChannel method Signed-off-by: Greg Wilkins <gregw@webtide.com> Co-authored-by: Lachlan Roberts <lachlan@webtide.com> Signed-off-by: Greg Wilkins <gregw@webtide.com> # Conflicts: # jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java # jetty-server/src/main/java/org/eclipse/jetty/server/Request.java # jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java # jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java
Fix #6860 IPv6 format by adding a per context configuration.
Signed-off-by: Greg Wilkins gregw@webtide.com