-
Notifications
You must be signed in to change notification settings - Fork 102
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
immutable $c->req (Catalyst::Request) #85
Comments
Maybe a plugin that makes the request immutable? |
-shrug- When I was learning Catalyst I had already shot myself in the foot long before I would have ever thought to go looking for plugins to stop me from doing something I didn't know was Bad. I would think it best for Catalyst to ship with the safety on. :) |
@jhannah I agree the point of catalyst (or one of its reasons to exist) is to guide newbies toward the right thing. I'd like to see Req fully immutable. We might start with a config switch on post params and headers and the PSGI env. I could default to sane mode but let people set a evil switch, something like $app->config->{mutable_request} =1 in case it breaks code for people. I think that's a pretty doable thing. |
++ I'm all for |
I think even just setting the request attributes to 'ro' and making sure On Thu, Feb 19, 2015 at 6:39 PM, Jay Hannah [email protected]
|
There are cases where it is useful and/or needed to modify the request. One such example was in the advent calendar: http://www.catalystframework.org/calendar/2014/18 I'm fine with a config option, but as there are projects and code which rely on the current behavior, I can't see this ever being made a default |
I think we could still make request immutable but make it more obivous how On Fri, Feb 20, 2015 at 1:17 PM, Henry Van Styn [email protected]
|
It seems to me life would be better if
$c->req
could not be altered. It's very tempting for Catalyst newbs (myself included, years ago) to alter the http request (filling it with lies), and then regret it later when MyApp grows. Better to stop people from shooting themselves in their future feet. Thanks.The text was updated successfully, but these errors were encountered: