Skip to content

4.5.14.1 - Workaround Vert.x issue with parameterized paths ending in wildcards

Choose a tag to compare

@guss77 guss77 released this 19 Apr 01:10
· 197 commits to master since this release

Due to a difference with how Vert.x handles paths that end with "/*" when the path have or doesn't have parameters (which probably shouldn't behave differently), using Irked bare annotations (without specifying a path) can cause handlers to not be invoked when you might think they should.

For example:

class Main extends Controller {
  @Endpoint("/foo/bar")
  FooBar foobar = new FooBar();
  @Endpoint("/foo/:baz")
  FooBar foobaz = new FooBar();
}
class FooBar extends Controller {
  @Get
  WebHandler hello = r -> r.send("Hello World");
}

In this case, You'd get "Hello World" from /foo/bar, /foo/bar/, /foo/bar/anything, /foo/baz/ and /foo/baz/anything, but not from /foo/baz (without a trailing slash or a suffix).

This version introduces a workaround to detect parameterized paths with wildcard ending and automatically add an additional handler to catch the missing request. This may introduce unexpected behaviors if your application relies on the no-trailing-slash request to not be handled, or some other edge cases, so it can be disabled by setting the Java system property irked.disable-normalize-wildcard-path-end to any value.