Skip to content

Commit

Permalink
Merge pull request quarkusio#15779 from geoand/quarkusio#15763
Browse files Browse the repository at this point in the history
Make sure the proper TCCL isn't lost in dev mode when static resource exist
  • Loading branch information
geoand committed Mar 17, 2021
2 parents e0aaae1 + 03a4cb0 commit fdc540a
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 lose the correct TCCL to Vert.x...
Thread.currentThread().setContextClassLoader(currentCl);
ctx.next();
}
});
Expand Down

0 comments on commit fdc540a

Please sign in to comment.