Open
Description
Hello,
Listening to Symfony Messenger workers raises a BadRequestException
from Symfony\Component\HttpFoundation\Request
.
It seems to be due to the introduction of a rejection of some characters in the URIs, including backslashes, by the Request class of the HTTPFoundation component:
symfony/http-foundation@32310ff#diff-de5d8eb3f1d6537c947f70e0a4673779312a902c083739f472c709c037bcbc30R370
if (false !== ($i = strpos($uri, '\\')) && $i < strcspn($uri, '?#')) {
throw new BadRequestException('Invalid URI: A URI cannot contain a backslash.');
}
Backslashes are used by the bundle in the transaction name, which is composed from the class name of the message, and the class name uses backslashes for the namespace:
Then the SymfonyProfiler
uses the transaction name in the URI:
And creates the Request:
I suggest fixing it by replacing the backslashes in the class name with regular slashes:
$transactionName = str_replace('\\', '/', \get_class($event->getEnvelope()->getMessage()));
$transactionName = str_replace('\\', '/', \get_class($envelope->getMessage()));
Metadata
Metadata
Assignees
Labels
No labels