amphp / http-server-router

A router for Amp's HTTP Server.
MIT License
38 stars 6 forks source link

Improve decoding path segments #16

Open kelunik opened 2 months ago

kelunik commented 2 months ago

See https://github.com/amphp/http-server-router/pull/15#issuecomment-2351217135

Here is my case:

  • Path is /.well-known/mercure/subscriptions/https%3A%2F%2Fexample.com%2Fmy-other-topic
  • The current code is transforming it to /.well-known/mercure/subscriptions/https://example.com/my-other-topic

It prevents fastroute to route correctly with the route /.well-known/mercure/subscriptions/{topic}. Maybe adding a test case with my case would be nice?

See also: https://github.com/amphp/http-server-router?tab=readme-ov-file#limitations

kelunik commented 2 months ago

Symfony seems to have the exact same behavior as we currently have: https://symfony.com/doc/current/routing.html#slash-characters-in-route-parameters