Fix: Usar URL interna para debug webhook receiver (bypass authentik)
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
This commit is contained in:
@@ -123,11 +123,19 @@ class WebhookDispatcher {
|
||||
headers['X-Webhook-Signature'] = `sha256=${signature}`
|
||||
}
|
||||
|
||||
// Check if the URL is pointing to our own debug receiver
|
||||
// If so, use internal URL to bypass authentik
|
||||
let targetUrl = webhook.url
|
||||
if (webhook.url.includes('/api/debug/webhook-receiver')) {
|
||||
const internalPort = process.env.PORT || 3000
|
||||
targetUrl = `http://localhost:${internalPort}/api/debug/webhook-receiver`
|
||||
}
|
||||
|
||||
const controller = new AbortController()
|
||||
const timeout = setTimeout(() => controller.abort(), webhook.timeout_ms)
|
||||
|
||||
try {
|
||||
const response = await fetch(webhook.url, {
|
||||
const response = await fetch(targetUrl, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body,
|
||||
|
||||
Reference in New Issue
Block a user