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 17, 2021
1 parent 55cf151 commit 03a4cb0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
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 lose the correct TCCL to Vert.x...
Thread.currentThread().setContextClassLoader(currentCl);
ctx.next();
}
});
Expand Down

0 comments on commit 03a4cb0

Please sign in to comment.