Skip to content

Commit

Permalink
patch to add the application/json header for OIDC metadata retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
leleuj committed Apr 6, 2023
1 parent 549298d commit 3a21347
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -174,10 +174,14 @@ protected void internalInit(final boolean forceReinit) {
// default value
if (getResourceRetriever() == null) {
try {
setResourceRetriever(SSLFactory == null ?
final DefaultResourceRetriever resourceRetriever = SSLFactory == null ?
new DefaultResourceRetriever(getConnectTimeout(),getReadTimeout()) :
new DefaultResourceRetriever(getConnectTimeout(),getReadTimeout(), 0, false,
(SSLSocketFactory) Class.forName(SSLFactory).getDeclaredConstructor().newInstance()));
(SSLSocketFactory) Class.forName(SSLFactory).getDeclaredConstructor().newInstance());
final Map<String, List<String>> headers = new HashMap<>();
headers.put(HttpConstants.CONTENT_TYPE_HEADER, Collections.singletonList(HttpConstants.APPLICATION_JSON));
resourceRetriever.setHeaders(headers);
setResourceRetriever(resourceRetriever);
} catch (ClassNotFoundException | InvocationTargetException | InstantiationException
| IllegalAccessException | NoSuchMethodException e) {
throw new TechnicalException("SSLFactory loaded fail, please check your configuration");
Expand Down

0 comments on commit 3a21347

Please sign in to comment.