Avoid JarURLConnection resource leak in AbstractFileResolvingResource.exists()
Closes gh-34528
This commit is contained in:
parent
1633ad24f3
commit
5ffaea7a43
|
@ -81,7 +81,10 @@ public abstract class AbstractFileResolvingResource extends AbstractResource {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (con.getContentLengthLong() > 0) {
|
||||
// Check content-length entry but not for JarURLConnection where
|
||||
// this would open the jar file but effectively never close it ->
|
||||
// for jar entries, always fall back to stream existence instead.
|
||||
if (!(con instanceof JarURLConnection) && con.getContentLengthLong() > 0) {
|
||||
return true;
|
||||
}
|
||||
if (httpCon != null) {
|
||||
|
|
Loading…
Reference in New Issue