Fondation

This commit is contained in:
alma 2026-01-17 13:47:59 +01:00
parent 7967d2d9c5
commit de64c10603

View File

@ -174,11 +174,11 @@ export async function GET(request: Request) {
); );
} }
const contentType = createTokenResponse.headers.get('content-type') || ''; const tokenContentType = createTokenResponse.headers.get('content-type') || '';
if (!contentType.includes('application/json')) { if (!tokenContentType.includes('application/json')) {
const errorText = await createTokenResponse.text().catch(() => 'Unknown error'); const errorText = await createTokenResponse.text().catch(() => 'Unknown error');
logger.error('[ROCKET_CHAT_USER_TOKEN] Expected JSON, got HTML', { logger.error('[ROCKET_CHAT_USER_TOKEN] Expected JSON, got HTML', {
contentType, contentType: tokenContentType,
errorPreview: errorText.substring(0, 200), errorPreview: errorText.substring(0, 200),
}); });
return NextResponse.json( return NextResponse.json(