-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Description
Alexey Veklov opened SPR-15556 and commented
Hi
It looks like ResourceUtils.extractArchiveURL also has an issue (Spring 4.3.8.RELEASE).
See comments in below snippet (marked with AV):
public static URL extractArchiveURL(URL jarUrl) throws MalformedURLException {
// AV jarUrl = war:file:/C:/<...>.war*/<...>/<...>.css
String urlFile = jarUrl.getFile();
// AV urlFile = file:/C:/<...>.war*/<...>/<...>.css
int endIndex = urlFile.indexOf(WAR_URL_SEPARATOR);
if (endIndex != -1) {
// Tomcat's "jar:war:file:...mywar.war*/WEB-INF/lib/myjar.jar!/myentry.txt"
String warFile = urlFile.substring(0, endIndex);
int startIndex = warFile.indexOf(WAR_URL_PREFIX); // AV <-- startIndex == -1
if (startIndex != -1) {
return new URL(warFile.substring(startIndex + WAR_URL_PREFIX.length()));
}
}
// Regular "jar:file:...myjar.jar!/myentry.txt"
return extractJarFileURL(jarUrl);
}
Affects: 4.3.8
Issue Links:
- PathMatchingResourcePatternResolver fails to work under Tomcat 8.0.41 with unpackWARs=false [SPR-15332] #19895 PathMatchingResourcePatternResolver fails to work under Tomcat 8.0.41 with unpackWARs=false
- Classpath Resource URL handling still wrong with Tomcat 8.5.12 [SPR-15681] #20240 Classpath Resource URL handling still wrong with Tomcat 8.5.12
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug