Skip to content

Commit 5dffed1

Browse files
waleedlatif1claude
andcommitted
fix(higgsfield): reject an unexpected 2xx from the key check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0070c03 commit 5dffed1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • apps/sim/lib/credentials/token-service-accounts/validators

‎apps/sim/lib/credentials/token-service-accounts/validators/higgsfield.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ export async function validateHiggsfieldServiceAccount(
3636
},
3737
'get_request_status'
3838
)
39+
if (response.ok) {
40+
await response.body?.cancel().catch(() => undefined)
41+
throw new TokenServiceAccountValidationError('provider_unavailable', response.status, {
42+
step: 'get_request_status',
43+
reason: 'expected 404 for an unknown request',
44+
})
45+
}
3946
if (response.status !== 404) await throwForProviderResponse(response, 'get_request_status')
4047
await response.body?.cancel().catch(() => undefined)
4148

0 commit comments

Comments
 (0)