fix: OAuthのContent-Typeを正しく判定するように

This commit is contained in:
kakkokari-gtyih
2026-03-03 19:05:15 +09:00
parent 810faa8e5d
commit 3fb80bc9b4

View File

@@ -142,7 +142,9 @@ async function discoverClientInformation(logger: Logger, httpRequestService: Htt
redirectUris.push(...httpLinkHeader.parse(linkHeader).get('rel', 'redirect_uri').map(r => r.uri));
}
if (res.headers.get('content-type')?.includes('application/json')) {
const contentType = res.headers.get('content-type');
const mediaType = contentType ? contentType.split(';')[0].trim() : null;
if (mediaType === 'application/json') {
// Client discovery via JSON document (11 July 2024 spec)
// https://indieauth.spec.indieweb.org/#client-metadata
// "Clients SHOULD have a JSON [RFC7159] document at their client_id URL containing