Files
api/services/nginx/app/tests/Unit/N8n/N8nWebhookUrlValidationWiringTest.php
T

14 lines
585 B
PHP

<?php
it('restricts absolute webhook URLs to configured n8n webhook host', function (): void {
$classFile = app_path('classes/n8n.php');
$content = file_get_contents($classFile);
expect($content)->not->toBeFalse();
expect($content)->toContain('isAllowedWebhookAbsoluteUrl');
expect($content)->toContain('Webhook URL must use the configured n8n webhook host.');
expect($content)->toContain("$targetHost !== $baseHost");
expect($content)->toContain("$targetScheme !== $baseScheme");
expect($content)->toContain('return $targetPort === $basePort;');
});