kjjfgdsf
sfdsfsdf
This commit is contained in:
@@ -66,7 +66,8 @@ router.post('/gitea', asyncHandler(async (req, res) => {
|
||||
try {
|
||||
validateGiteaWebhook(req)
|
||||
} catch (err) {
|
||||
if (err.name === 'AuthorizationError' || err.statusCode === 401) throw err
|
||||
// AuthorizationError uses statusCode 403, not 401 — do not rely on err.name (can be wrong on some engines)
|
||||
if (err instanceof AuthorizationError) throw err
|
||||
log.error('Gitea Webhook: Validierung fehlgeschlagen', { error: err.message })
|
||||
return res.status(401).json({ error: 'Webhook validation failed' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user