Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Routing] Url Generator and slashes in url parameters #13017

Copy link
Copy link
Closed
@imunhatep

Description

@imunhatep
Issue body actions

Currently symfony does not allow to generate urls with encoded slash in slug. Ex:

_some_route:
    path: /create/{folder}/zip

If folder parameter value is: /home/user, either I have to allow / in url parameter or do parameter encoding before passing it to the UrlGenerator.
In the first case we get raw path: /create//home/user/zip
In the second case, UrlGeneretor will double encode the parameter: /create/%252Fhome%252Fuser/zip.
But neither give desired output: /create/%2Fhome%2Fuser/zip

I saw remark in the UrlGenerator code to problems with JBOSS and Apache for url with encoded slashes (http://stackoverflow.com/questions/4069002/http-400-if-2f-part-of-get-url-in-jboss), also it looks more like a bug to me, nevertheless I think it should be handled by programmers that work with that systems, cause encoded slash is fully valid in url.

Also current approach forces to use double decoding on servers with proper handling of urls, or overriding url generator class in symfony.

I do understand that my proposal will break back-compatibility, but I think this behavior should be discussed at least for future versions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.