File tree Expand file tree Collapse file tree
spring-core/src/main/java/org/springframework/core/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,9 +63,11 @@ public boolean exists() {
6363 httpCon .setRequestMethod ("HEAD" );
6464 int code = httpCon .getResponseCode ();
6565 if (code == HttpURLConnection .HTTP_OK ) {
66+ httpCon .disconnect ();
6667 return true ;
6768 }
6869 else if (code == HttpURLConnection .HTTP_NOT_FOUND ) {
70+ httpCon .disconnect ();
6971 return false ;
7072 }
7173 else if (code == HttpURLConnection .HTTP_BAD_METHOD ) {
@@ -74,9 +76,11 @@ else if (code == HttpURLConnection.HTTP_BAD_METHOD) {
7476 if (con instanceof HttpURLConnection newHttpCon ) {
7577 code = newHttpCon .getResponseCode ();
7678 if (code == HttpURLConnection .HTTP_OK ) {
79+ newHttpCon .disconnect ();
7780 return true ;
7881 }
7982 else if (code == HttpURLConnection .HTTP_NOT_FOUND ) {
83+ newHttpCon .disconnect ();
8084 return false ;
8185 }
8286 httpCon = newHttpCon ;
You can’t perform that action at this time.
0 commit comments