You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
This PR was merged into the 6.3 branch.
Discussion
----------
[Webhook] Allow slash in webhook type
| Q | A
| ------------- | ---
| Branch? | 6.3
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#50973 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Allow `/` in webhook type.
This allow to have route like`/webhook/foo/bar`
Commits
-------
d2ae524 [Webhook] Allow slash in webhook type
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 parameterHow to reproduce
Install a new
symfony/webhook
componentAdd a new webhook config with a
/
character in the routeThe route won't match and return 404
Possible Solution
Apply the solution from the routing documentation when configuring
WebhookController
classAdditional Context
No response
The text was updated successfully, but these errors were encountered: