Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize regexp in Plack::App::URLMap #617

Open
matjmat opened this issue Mar 12, 2018 · 0 comments
Open

Authorize regexp in Plack::App::URLMap #617

matjmat opened this issue Mar 12, 2018 · 0 comments

Comments

@matjmat
Copy link

matjmat commented Mar 12, 2018

Hi,
I understand that we cannot currently use regexp in the path when mounting an application, mainly due to:

 push @{$self->{_mapping}}, [ $host, $location, qr/^\Q$location\E/, $app ];

in: Plack::App::URLMap

I would like to know:

  • if there is a way to do it right now without modifying the code
  • what is the rational behing using the \Q and avoiding regexp (i suspect something linked to security reasons)
  • if it could be possible to add a $ENV parameter for authorizing the use of regexp in the map() something along:
    ``if ( $ENV{PLACK_URLMAP_ALLOWREGEX} ) {
    push @{$self->{_mapping}}, [ $host, $location, qr/^$location/, $app ];
    } else {
    push @{$self->{_mapping}}, [ $host, $location, qr/^\Q$location\E/, $app ];
    }
    (happy to provide a real patch if ok in the idea)

Best,
Mathieu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant