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

Plack::Util::load_psgi: guard against hitting the identifier length limit #663

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hugmeir
Copy link

@Hugmeir Hugmeir commented Feb 19, 2021

When Plack is asked to load a path with a psgi app inside,
ala /foo/bar/app.psgi, it first generates a namespace for
the file -- something like Plack::Sandbox::_2ffoo_2fbar_2fapp_2epsgi.

Those "sandboxed" namespaces can get very long. Long enough
that they hit Perl's identifier limit of ~250 characters
(see https://perldoc.perl.org/perldiag#Identifier-too-long).

This commit patches Plack::Util::load_psgi()
that always generates paths shorter than the threshold,
and jumps through some hoops to ensure that no two
applications end up sharing namespaces after the trimming.

…imit

When Plack is asked to load a path with a psgi app inside,
ala /foo/bar/app.psgi, it first generates a namespace for
the file -- something like Plack::Sandbox::_2ffoo_2fbar_2fapp_2epsgi.

Those "sandboxed" namespaces can get very long.  Long enough
that they hit Perl's identifier limit of ~250 characters
(see https://perldoc.perl.org/perldiag#Identifier-too-long).

This commit patches Plack::Util::load_psgi()
that always generates paths shorter than the threshold,
and jumps through some hoops to ensure that no two
applications end up sharing namespaces after the trimming.
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

Successfully merging this pull request may close these issues.

1 participant