You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RestfulController should support updates via POST in addition to PUT or allow additional configuration. #9926
According to burt [9:01 PM]
I looked at this in a debugger and it's hard to tell because it's mostly generated code, but the controller ends up being a subclass of RestfulController and there's code generated by an AST that does the check for allowed methods and that's where the 405 status is being set. it looks to me like it's ignoring the allowedMethods map defined in the controller and using the one from the RestfulController base class with the standard values
it looks to me like it's ignoring the allowedMethods map defined in the controller and using the one from the RestfulController base class with the standard values
That is correct. At present the code that deals with allowedMethods restrictions is added directly the controller action methods at compile time so when RestfulController is compiled, the allowedMethods property in that class are what is used. That could be modified to support a subclass' allowedMethods, but that is not what currently happens.
So you would classify this as a bug, no? Maybe at the very least we can open up POSTs to updates. I don't really see a security problem with this, do you?
The more I think about it, wouldn't it be better if RestfulController didn't even have static allowedMethods? What is the point of it having it anyhow? Just because someone want's to expose rest services on their controller, doesn't mean it should be locked down from a security stand point.
Activity
jeffscottbrown commentedon May 11, 2016
That is correct. At present the code that deals with
allowedMethodsrestrictions is added directly the controller action methods at compile time so whenRestfulControlleris compiled, theallowedMethodsproperty in that class are what is used. That could be modified to support a subclass'allowedMethods, but that is not what currently happens.Allow restful POST updates apache#9926
codeconsole commentedon May 12, 2016
So you would classify this as a bug, no? Maybe at the very least we can open up POSTs to updates. I don't really see a security problem with this, do you?
codeconsole commentedon May 12, 2016
The more I think about it, wouldn't it be better if RestfulController didn't even have static allowedMethods? What is the point of it having it anyhow? Just because someone want's to expose rest services on their controller, doesn't mean it should be locked down from a security stand point.
Allow restful POST updates apache#9926
Merge pull request #9930 from codeconsole/3.1.x-9926
Merge pull request #9928 from codeconsole/9926
jeffscottbrown commentedon May 26, 2016
I don't agree. I think
RestfulControllershould have sensible restrictions in it, and you should be allowed to override those.feat: disable the hidden HTTP method filter by default
feat: disable the hidden HTTP method filter by default
fix: keep g:form emitting _method in both modes
feat: disable the hidden HTTP method filter by default
fix: keep g:form emitting _method in both modes
test: assert the whole request path in one round trip