Closed
Description
Symfony version(s) affected
6.3.0
Description
Webhook routing with a /
character in the path doesn't work. This is due to the Symfony router by default doesn't allow a /
character in a route parameter
// config/webhook.php
<?php
declare(strict_types=1);
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\Config\FrameworkConfig;
return static function (FrameworkConfig $framework): void {
$webhookConfig = $framework
->webhook();
$webhookConfig->routing('some-service/orders') // <-- notice `/` in the path
->service(SomeServiceOrderWebhookRequestParser::class)
->secret('some-secret');
};
How to reproduce
Install a new symfony/webhook
component
Add a new webhook config with a /
character in the route
The route won't match and return 404
Possible Solution
Apply the solution from the routing documentation when configuring WebhookController
class
Additional Context
No response