jooby-project / jooby

The modular web framework for Java and Kotlin
https://jooby.io
Apache License 2.0
1.7k stars 198 forks source link

endpoint path with regex defined params problems after jooby upgrade 1.0.0.CR6 → 1.0.0.CR8 #526

Closed dapalt closed 7 years ago

dapalt commented 7 years ago

Hi, after upgrading jooby (1.0.0.CR6 → 1.0.0.CR8) some of my endpoint paths are not recognized anymore.

For example when I wanted to pass param with defined first letter and number length I used to construct endpoint like: get("/V{var:\\d{4,7}}/", req -> ImmutableMap.of("var", req.param("var").value()));

Changing it to: get("/V{var:\\d+}/", req -> ImmutableMap.of("var", req.param("var").value())); works but I need to validate my parameter manually and throw 404/invoke next route.

Another problem associated with upgrade and route params is passing url-encoded parameters with special chars to get method: get("/:var", req -> ImmutableMap.of("var", req.param("var").value())) // 404 for /x%252Fy%252Fz

Are these changes intentional?

Thank you in advance

jknack commented 7 years ago

Side effect of #462.

Will fix soon.

Thanks for reporting and if you enjoy Jooby like we do.. please star our project and follows at twitter.

jknack commented 7 years ago

What is the output for:

get("/:var", req -> ImmutableMap.of("var", req.param("var").value()))

GET /x%252Fy%252Fz

in CR6? Which server? Netty? Jetty? or Undertow?

dapalt commented 7 years ago

Netty. I'm pretty sure it was page not found, when i logged requests comming it was recognized as: /x/y/z in CR6 it was treated as single parameter when i used url encoding. I will edit this post and add some logs in about 8-10 hours.

Star given, great job :)

jknack commented 7 years ago

@dmnp all good, that is what I got too. :)