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

multipart request sometimes causes infinit loop #182

Closed
wants to merge 1 commit into from

Conversation

jamadam
Copy link
Contributor

@jamadam jamadam commented Jul 22, 2011

I found multipart request sometimes causes infinit loop.
This is very rare case and not occurs on proper way to use of Mojolicious.
You can reproduce it by parsing request twice with hash or hash reference for argument.
Parsing request twice may not be a good idea but avoiding the infinit loop makes the class more reliable.

I encountered this when I was working on a plugin which reconstract the request with modified %ENV inside on_process.

https://github.com/jamadam/Mojolicious-Plugin-PlackMiddleware/blob/master/lib/Mojolicious/Plugin/PlackMiddleware.pm#L128

@kraih
Copy link
Member

kraih commented Jul 22, 2011

Yes, parsing multiple times is a very bad idea and i'm sure it will cause many more problems.
This does not seem like a real solution though.

@kraih kraih closed this Jul 22, 2011
@jamadam
Copy link
Contributor Author

jamadam commented Jul 22, 2011

Ok. I'll look for another workround. Thank you.

@kraih
Copy link
Member

kraih commented Jul 22, 2011

I'm sure you'll find a lot of helpful tests in "t/mojo/message.t", there are many special cases that would have to be tested for reparsing too.

@jamadam
Copy link
Contributor Author

jamadam commented Jul 22, 2011

Thanks. I'll look into that.

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.

None yet

2 participants