KEYCLOAK-8008 Ensure InputStream are closed
This commit is contained in:
parent
e1ecf94428
commit
4b9b189016
2 changed files with 8 additions and 6 deletions
|
@ -68,10 +68,11 @@ public class AuthorizationEndpointRequestParserProcessor {
|
|||
if (requestParam != null) {
|
||||
new AuthzEndpointRequestObjectParser(session, requestParam, client).parseRequest(request);
|
||||
} else if (requestUriParam != null) {
|
||||
InputStream is = session.getProvider(HttpClientProvider.class).get(requestUriParam);
|
||||
String retrievedRequest = StreamUtil.readString(is);
|
||||
try (InputStream is = session.getProvider(HttpClientProvider.class).get(requestUriParam)) {
|
||||
String retrievedRequest = StreamUtil.readString(is);
|
||||
|
||||
new AuthzEndpointRequestObjectParser(session, retrievedRequest, client).parseRequest(request);
|
||||
new AuthzEndpointRequestObjectParser(session, retrievedRequest, client).parseRequest(request);
|
||||
}
|
||||
}
|
||||
|
||||
return request;
|
||||
|
|
|
@ -36,8 +36,9 @@ import java.security.PublicKey;
|
|||
public class JWKSHttpUtils {
|
||||
|
||||
public static JSONWebKeySet sendJwksRequest(KeycloakSession session, String jwksURI) throws IOException {
|
||||
InputStream is = session.getProvider(HttpClientProvider.class).get(jwksURI);
|
||||
String keySetString = StreamUtil.readString(is);
|
||||
return JsonSerialization.readValue(keySetString, JSONWebKeySet.class);
|
||||
try (InputStream is = session.getProvider(HttpClientProvider.class).get(jwksURI)){
|
||||
String keySetString = StreamUtil.readString(is);
|
||||
return JsonSerialization.readValue(keySetString, JSONWebKeySet.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue