You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using quarkus-resteasy-reactive, appending any extra character in the end of a valid path doesn't result in 404 but instead gets to the existing valid route
making simple @Path("hello") resource, will return a response when calling /hello, but also /helloX (X = any character) and /helloX/, while the invalid paths should result in 404
appending more than 1 character results in a valid behaviour and returns 404
seems that the PathMatcher treats the last character as if it was a trailing slash since in some places in the code only the length of the remaining path part is checked (I suppose for performance reasons?)
quarkus-resteasy PathMatcher does behave as expected
Expected behavior
/hello should return a response /helloX and /helloX/ should return 404 (X == any character)
Actual behavior
/hello should return a response /helloX and /helloX/ return same response as /hello
How to Reproduce?
create a starter quarkus project with quarkus-resteasy-reactive extension
add a simple hello resource
(kotlin version)
@Path("hello")
class HelloResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
fun hello() : String {
return "Hello"
}
}
Output of uname -a or ver
Darwin MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64
Output of java -version
openjdk version "16.0.2" 2021-07-20; OpenJDK Runtime Environment Corretto-16.0.2.7.1 (build 16.0.2+7)
GraalVM version (if different from Java)
Quarkus version or git rev
2.6.3.Final
Build tool (ie. output of mvnw --version or gradlew --version)
Gradle 6.9
Additional information
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
when using quarkus-resteasy-reactive, appending any extra character in the end of a valid path doesn't result in 404 but instead gets to the existing valid route
making simple
@Path("hello")
resource, will return a response when calling /hello, but also /helloX (X = any character) and /helloX/, while the invalid paths should result in 404appending more than 1 character results in a valid behaviour and returns 404
seems that the
PathMatcher
treats the last character as if it was a trailing slash since in some places in the code only the length of the remaining path part is checked (I suppose for performance reasons?)quarkus-resteasy PathMatcher does behave as expected
Expected behavior
/hello
should return a response/helloX
and/helloX/
should return 404 (X == any character)Actual behavior
/hello
should return a response/helloX
and/helloX/
return same response as/hello
How to Reproduce?
create a starter quarkus project with quarkus-resteasy-reactive extension
add a simple hello resource
(kotlin version)
Output of
uname -a
orver
Darwin MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "16.0.2" 2021-07-20; OpenJDK Runtime Environment Corretto-16.0.2.7.1 (build 16.0.2+7)
GraalVM version (if different from Java)
Quarkus version or git rev
2.6.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 6.9
Additional information
No response
The text was updated successfully, but these errors were encountered: