[java-shib-shared] branch main updated: Close input stream from resource-backed script.

Scott Cantor cantor.2 at osu.edu
Thu Jun 15 17:23:19 UTC 2023


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

scantor pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=704ba66bc677b416f4c4107177505694d978d5a1

The following commit(s) were added to refs/heads/main by this push:
     new 704ba66b Close input stream from resource-backed script.
704ba66b is described below

commit 704ba66bc677b416f4c4107177505694d978d5a1
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jun 15 13:23:16 2023 -0400

    Close input stream from resource-backed script.
---
 .../main/java/net/shibboleth/shared/scripting/EvaluableScript.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/shib-support/src/main/java/net/shibboleth/shared/scripting/EvaluableScript.java b/shib-support/src/main/java/net/shibboleth/shared/scripting/EvaluableScript.java
index f74b6cfb..112255a7 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/scripting/EvaluableScript.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/scripting/EvaluableScript.java
@@ -136,7 +136,9 @@ public final class EvaluableScript extends AbstractInitializableComponent {
 
         Constraint.isNotNull(scriptSource, "Script source should not be null");
 
-        setScript(Constraint.isNotNull(scriptSource, "Script source can not be null or empty").getInputStream());
+        try (final InputStream is = scriptSource.getInputStream()) {
+            setScript(is);
+        }
     }
 
     /**

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


More information about the commits mailing list