-
Notifications
You must be signed in to change notification settings - Fork 214
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
protect against loading a dir - do $dir
no set $@
or $!
#609
base: master
Are you sure you want to change the base?
Conversation
{ | ||
eval { Plack::Util::load_psgi("t/Plack-Util/") }; | ||
# Perl 5.20+ gives "Did you try to load a directory", | ||
# <=5.18 "No such file or directory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was highly surprised as well. See Travis's results on the previous version of this before I force-pushed this over the top: https://travis-ci.org/plack/Plack/builds/323431062
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed perl 5.18 reports "No such file or directory" given a directory as its argument for do
. I think it's worth reporting to upstream (p5p) or make sure if this was an intentional change, since the previous behavior was more useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead! In the meantime, unless there will be further releases of 5.20 etc, it seems like this is a useful change. Do you require changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well since you discovered it you go ahead and report it :)
this will give the same error message for a valid perl code that failed to return from .psgi
. You're right that a false value is not a right PSGI application, but the error message seems misleading to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will adjust it now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it will just report returned invalid value.
, which seems to me Ok when appended to the existing Error while loading $_file:
?
@miyagawa Have you had a chance to review this? |
Arguably this is a shortcoming in Perl's
do
. Anyway, I claim that a false$app
is an invalid thing to return fromload_psgi
, sodie
ing is always appropriate. Comments welcome!