Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

onderson
Copy link
Contributor

No description provided.

@@ -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")
Copy link
Contributor

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();
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@onderson onderson May 23, 2017

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) {
Copy link
Contributor Author

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.

@davsclaus
Copy link
Contributor

Thanks for the PR it has been merged. Do you mind closing this?

@onderson
Copy link
Contributor Author

thanks for accepting. closing.

@onderson onderson closed this May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants