File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
apps/sim/app/api/webhooks/test Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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 } ` , {
You can’t perform that action at this time.
0 commit comments