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
CAMEL-11254-Default matchOnUriPrefix to false on Undertow endpoint #1709
Conversation
@@ -69,11 +69,11 @@ protected RouteBuilder createRouteBuilder() throws Exception { | |||
return new RouteBuilder() { | |||
@Override | |||
public void configure() throws Exception { | |||
from("undertow:http://localhost:{{port}}/headers") | |||
from("undertow:http://localhost:{{port}}/headers??matchOnUriPrefix=false") |
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.
There is a double ? sign here
@@ -85,7 +85,7 @@ public synchronized void registerHandler(HttpHandlerRegistrationInfo registratio | |||
|
|||
String path = registrationInfo.getUri().getPath(); | |||
String methods = registrationInfo.getMethodRestrict(); | |||
boolean prefixMatch = registrationInfo.isMatchOnUriPrefix(); | |||
boolean prefixMatch = !registrationInfo.isMatchOnUriPrefix(); |
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.
Why is the boolean inverted?
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.
Yeah that can't be right. The original code should be fine here (same for the other similar change below).
With this change prefixMatch
will equal true
if the matchOnUriPrefix
endpoint config value is false
. Which is the total opposite of the desired behaviour.
We only want the Undertow consumer to match on URI prefixes if matchOnUriPrefix == true
.
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.
i thought i reverted the source back before checking in. I'd done it because if i don't invert, it seems all rest UTs are broken which was leading RootHandler to be registered twice and tests were getting broken completely. I inverted and that explains why i got BUILD SUCCESS then i checked in..
@@ -69,7 +69,7 @@ public synchronized void add(String path, String[] methods, boolean prefixMatch, | |||
// Adding a handler for the static path | |||
if (basePathHandler instanceof CamelPathTemplateHandler) { | |||
CamelPathTemplateHandler templateHandler = (CamelPathTemplateHandler)basePathHandler; | |||
if (prefixMatch) { | |||
if (!prefixMatch) { |
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.
As default is false from now on, default handler is obtained by inversion.
Thanks for the PR it has been merged. Do you mind closing this? |
thanks for accepting. closing. |
No description provided.