Skip to content

Commit

Permalink
Make sure the proper TCCL isn't lost in dev mode when static resource…
Browse files Browse the repository at this point in the history
… exist

Fixes: quarkusio#15763
  • Loading branch information
geoand committed Mar 16, 2021
1 parent 810b9e8 commit b36181e
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -52,13 +52,16 @@ public Consumer<Route> start() {
}
}
if (!knownPaths.isEmpty()) {
ClassLoader currentCl = Thread.currentThread().getContextClassLoader();
StaticHandler staticHandler = StaticHandler.create(META_INF_RESOURCES).setDefaultContentEncoding("UTF-8");
handlers.add(ctx -> {
String rel = ctx.mountPoint() == null ? ctx.normalisedPath()
: ctx.normalisedPath().substring(ctx.mountPoint().length());
if (knownPaths.contains(rel)) {
staticHandler.handle(ctx);
} else {
// make sure we don't loose the correct TCCL to Vert.x...
Thread.currentThread().setContextClassLoader(currentCl);
ctx.next();
}
});
Expand Down

0 comments on commit b36181e

Please sign in to comment.