-
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
PR #660 breaks POST requests in app with Plack::Middleware::Static #683
Comments
Thanks for the report. Reverted the change in #684 and shipped as 1.0050. |
Is this accurate? the middleware still checks for the return value of Did you have |
Yes, I was wrong. I didn’t know about enable 'Plack::Middleware::Static', (
path => sub {
s!/$!/index.html!;
return 1;
},
pass_through => 1,
root => File::Spec->catdir( $PROJECT_ROOT, 'html' ),
);
I feel like there could be a setting to enable serving of index files automatically. |
ok, that makes sense, since What I was curious was that your original code didn't include |
Correct. I carefully wrote
Correct, as stated above. |
Can you reproduce the error? In v1.0049, if the |
i can't reproduce the error with 1.0049:
if I return 1 from the
|
In #681 I had a PR that should have fixed 1.0049 by moving the method check until after the location checl. The PR also has a test that a POST passthrough worked. |
Ah, sorry. I just assumed the example was a cut-and-paste error. |
@dboehmer can you go back to 1.0049 and your original code and reproduce the error? Your original statement:
You're saying that you were not using I can't see how that's happening, and I can't reproduce that (see above). It would be nice if you can reproduce it so we can investigate further. |
I am working on a Plack app using Plack::Middleware::Static and a coderef for
path
. Since #660 all POST requests fail because Plack::App::File returns 405 for non GET/HEAD requests regardless of the return value of thepath
coderef.I think, the check for the HTTP method should be done only after
path
returned a true value. At the same time maybe we should another part of Plack to do the URL handling?Our app has static files and dynamic endpoints mixed in the same namespace. Unfortunately the URL namespace was designed with a different scheme. I chose to use Plack::Middleware::Static to do the URL handling and handle static files.
The code looks like this:
This is not the nicest thing but this is part of a longer migration from CGI to a modern web framework.
The text was updated successfully, but these errors were encountered: