[java-identity-provider] branch main updated: IDP-2088 AbstractIdPModule.BasicModuleResource may orphan a ClassicHttpResponse

Rod Widdowson rdw at steadingsoftware.com
Sat Apr 8 10:52:04 UTC 2023


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=af13946836910db4e0ae8dfb6573ba0dcdef25f3

The following commit(s) were added to refs/heads/main by this push:
     new af1394683 IDP-2088 AbstractIdPModule.BasicModuleResource may orphan a ClassicHttpResponse
af1394683 is described below

commit af13946836910db4e0ae8dfb6573ba0dcdef25f3
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Apr 8 11:51:44 2023 +0100

    IDP-2088 AbstractIdPModule.BasicModuleResource may orphan a ClassicHttpResponse
    
    https://shibboleth.atlassian.net/browse/IDP-2088
    
    Use e ConnectionClosingInputStream
---
 idp-admin-api/pom.xml                                                | 5 +++++
 .../src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java   | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/idp-admin-api/pom.xml b/idp-admin-api/pom.xml
index d29969b13..ec0d1c005 100644
--- a/idp-admin-api/pom.xml
+++ b/idp-admin-api/pom.xml
@@ -65,6 +65,11 @@
             <artifactId>shib-networking</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>${shib-shared.groupId}</groupId>
+            <artifactId>shib-networking-spring</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
index dd56efbad..31194edb2 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
@@ -58,6 +58,7 @@ import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.shared.primitive.StringSupport;
+import net.shibboleth.shared.spring.httpclient.resource.ConnectionClosingInputStream;
 
 /**
  * {@link IdPModule} base class implementing basic file management.
@@ -388,9 +389,8 @@ public abstract class AbstractIdPModule implements IdPModule {
                 }
                 
                 // The response socket should be closed after the stream is closed.
-                final InputStream ret = response.getEntity().getContent();
+                final InputStream ret = new ConnectionClosingInputStream(response);
                 response = null;
-                assert ret != null;
                 return ret;
             } finally {
                 if (response != null && CloseableHttpResponse.class.isInstance(response)) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list