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

RESTEasy standalone - handle @ApplicationPath value correctly #4814

Merged
merged 1 commit into from Oct 25, 2019

Conversation

@mkouba
Copy link
Contributor

mkouba commented Oct 23, 2019

  • application path value does not have to start with a slash
  • resource should not be served from both the root and the app path
  • resolves #4787

IMPL NOTE: We register the delegating handler in the default route (matches HttpBuildTimeConfig.path) for a JAX-RS root resource path of a default value /. However, for any other value we do register the handler in a special route that matches the root resource path. In fact, we register two routes that share the same handler. For example, for the JAX-RS root resource path /foo we register two routes, first matches /foo (exact match) and the second one matches /foo/*. And the reason is that otherwise the resources would be served from both the root and the app path - see the issue description for an example.

@mkouba mkouba requested review from patriot1burke, cescoffier and stuartwdouglas and removed request for patriot1burke and cescoffier Oct 23, 2019
@mkouba mkouba added this to the 0.27.0 milestone Oct 23, 2019
@mkouba mkouba requested a review from cescoffier Oct 23, 2019
Copy link
Contributor

patriot1burke left a comment

Should write a regression test for this. I don't see one. I imagine we might want to rework route processing int he future and there's no test for this case.

@stuartwdouglas

This comment has been minimized.

Copy link
Member

stuartwdouglas commented Oct 23, 2019

LGTM except the lack of tests

@mkouba

This comment has been minimized.

Copy link
Contributor Author

mkouba commented Oct 24, 2019

Good point with the tests. I'll add some.

- application path value does not have to start with a slash
- resource should not be served from both the root and the app path
- resolves #4787
@mkouba mkouba force-pushed the mkouba:issue-4787 branch from 7ceb271 to f2c336c Oct 24, 2019
@mkouba

This comment has been minimized.

Copy link
Contributor Author

mkouba commented Oct 24, 2019

Tests added...

@mkouba mkouba requested a review from patriot1burke Oct 24, 2019
@mkouba

This comment has been minimized.

Copy link
Contributor Author

mkouba commented Oct 24, 2019

@patriot1burke Pls could you re-review this PR again?

@gsmet
gsmet approved these changes Oct 25, 2019
Copy link
Member

gsmet left a comment

We have a proper test now, let's get it in the tree early.

@gsmet gsmet dismissed patriot1burke’s stale review Oct 25, 2019

Test added.

@gsmet gsmet merged commit c170cd8 into quarkusio:master Oct 25, 2019
23 checks passed
23 checks passed
WIP Ready for review
Details
quarkusio.quarkus Build #20191024.24 succeeded
Details
quarkusio.quarkus (Build for Native Build JDK8 Linux) Build for Native Build JDK8 Linux succeeded
Details
quarkusio.quarkus (Maven Cache Linux Maven Repo) Maven Cache Linux Maven Repo succeeded
Details
quarkusio.quarkus (Maven Cache Windows Maven Repo) Maven Cache Windows Maven Repo succeeded
Details
quarkusio.quarkus (Native Tests amazon-dynamodb, amazon-lambda) Native Tests amazon-dynamodb, amazon-lambda succeeded
Details
quarkusio.quarkus (Native Tests artemis-core, artemis-jms, kafka) Native Tests artemis-core, artemis-jms, kafka succeeded
Details
quarkusio.quarkus (Native Tests elytron-security-oauth2, elytron-security, oidc, vault-app) Native Tests elytron-security-oauth2, elytron-security, oidc, vault-app succeeded
Details
quarkusio.quarkus (Native Tests flyway, hibernate-orm-panache, reactive-pg-client) Native Tests flyway, hibernate-orm-panache, reactive-pg-client succeeded
Details
quarkusio.quarkus (Native Tests hibernate-search-elasticsearch) Native Tests hibernate-search-elasticsearch succeeded
Details
quarkusio.quarkus (Native Tests infinispan-cache-jpa, infinispan-client, mongodb-client, mongodb-panache, neo4j, narayana-stm) Native Tests infinispan-cache-jpa, infinispan-client, mongodb-client, mongodb-panache, neo4j, narayana-stm succeeded
Details
quarkusio.quarkus (Native Tests jackson, jsonb, jgit, kogito, kubernetes-client) Native Tests jackson, jsonb, jgit, kogito, kubernetes-client succeeded
Details
quarkusio.quarkus (Native Tests jpa, jpa-postgresql, jpa-mysql) Native Tests jpa, jpa-postgresql, jpa-mysql succeeded
Details
quarkusio.quarkus (Native Tests jpa-h2, jpa-mariadb, jpa-mssql, jpa-derby) Native Tests jpa-h2, jpa-mariadb, jpa-mssql, jpa-derby succeeded
Details
quarkusio.quarkus (Native Tests main) Native Tests main succeeded
Details
quarkusio.quarkus (Native Tests resteasy-jackson, vertx, vertx-http, virtual-http) Native Tests resteasy-jackson, vertx, vertx-http, virtual-http succeeded
Details
quarkusio.quarkus (Native Tests spring-di, spring-web, spring-data-jpa) Native Tests spring-di, spring-web, spring-data-jpa succeeded
Details
quarkusio.quarkus (Native Tests tika, hibernate-validator, test-extension) Native Tests tika, hibernate-validator, test-extension succeeded
Details
quarkusio.quarkus (Run JVM Tests Build JDK8 Linux) Run JVM Tests Build JDK8 Linux succeeded
Details
quarkusio.quarkus (Run JVM Tests Linux JDK11 Build) Run JVM Tests Linux JDK11 Build succeeded
Details
quarkusio.quarkus (Run JVM Tests Linux JDK12 Build) Run JVM Tests Linux JDK12 Build succeeded
Details
quarkusio.quarkus (Run JVM Tests Run_TCKs) Run JVM Tests Run_TCKs succeeded
Details
quarkusio.quarkus (Run JVM Tests Windows JVM Build) Run JVM Tests Windows JVM Build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.