From: Wes Biggs Date: Tue, 26 Nov 2024 17:21:20 +0000 (-0600) Subject: Updates the OIDC userinfo endpoint request to allow for a `Content-Type` response... X-Git-Tag: v24.10.3~2^2~4^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/17f7afe12d617358ba59489fb544f339839e7370 Updates the OIDC userinfo endpoint request to allow for a `Content-Type` response header with optional parameters, like `application/json; charset=utf-8`. This was causing an issue when integrating with [node-oidc-provider](https://github.com/panva/node-oidc-provider). --- diff --git a/app/Access/Oidc/OidcUserinfoResponse.php b/app/Access/Oidc/OidcUserinfoResponse.php index 9aded654e..ffcacb8de 100644 --- a/app/Access/Oidc/OidcUserinfoResponse.php +++ b/app/Access/Oidc/OidcUserinfoResponse.php @@ -11,7 +11,7 @@ class OidcUserinfoResponse implements ProvidesClaims public function __construct(ResponseInterface $response, string $issuer, array $keys) { - $contentType = $response->getHeader('Content-Type')[0]; + $contentType = explode(';', $response->getHeader('Content-Type')[0], 2)[0]; if ($contentType === 'application/json') { $this->claims = json_decode($response->getBody()->getContents(), true); }