Skip to content

Commit 9962d44

Browse files
author
waleed
committed
ack PR comments
1 parent 46ca31e commit 9962d44

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/sim/app/api/webhooks/test/route.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ export async function GET(request: NextRequest) {
3535
const provider = foundWebhook.provider || 'generic'
3636
const providerConfig = (foundWebhook.providerConfig as Record<string, any>) || {}
3737

38-
const baseUrl = env.NEXT_PUBLIC_APP_URL || new URL(request.url).origin
38+
if (!env.NEXT_PUBLIC_APP_URL) {
39+
logger.error(`[${requestId}] NEXT_PUBLIC_APP_URL not configured, cannot test webhook`)
40+
return NextResponse.json(
41+
{ success: false, error: 'NEXT_PUBLIC_APP_URL must be configured' },
42+
{ status: 500 }
43+
)
44+
}
45+
const baseUrl = env.NEXT_PUBLIC_APP_URL
3946
const webhookUrl = `${baseUrl}/api/webhooks/trigger/${foundWebhook.path}`
4047

4148
logger.info(`[${requestId}] Testing webhook for provider: ${provider}`, {

0 commit comments

Comments
 (0)