Skip to content

Commit

Permalink
Fix theme resource loading on Windows, and enable additional test in …
Browse files Browse the repository at this point in the history
…jdk-integration-tests (keycloak#33512)

Closes keycloak#33508

Signed-off-by: stianst <stianst@gmail.com>
  • Loading branch information
stianst authored Oct 3, 2024
1 parent de151e6 commit 6092524
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ public static InputStream getResourceAsStream(String root, String resource) thro
Path rootPath = Path.of("/", root).normalize().toAbsolutePath();
Path resourcePath = rootPath.resolve(resource).normalize().toAbsolutePath();
if (resourcePath.startsWith(rootPath)) {
URL url = classLoader().getResource(resourcePath.toString().substring(1));
if (File.separatorChar == '/') {
resource = resourcePath.toString().substring(1);
} else {
resource = resourcePath.toString().substring(2).replace('\\', '/');
}
URL url = classLoader().getResource(resource);
return url != null ? url.openStream() : null;
} else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ SSOTest
SamlClientTest
TransactionsTest
X509BrowserLoginTest
ThemeResourceProviderTest

0 comments on commit 6092524

Please sign in to comment.