Closed ngallagher87 closed 11 years ago
I'll add a test for this case. I've seen the bug too, and I think the restrictTo
should be possible to set globally for a route.
Unfortunately, restrictTo
is only available in a routing context, and it does not save the state (only checks the state of the current call). This means that it would need to be reworked to cover all calls in the current API.
I've added a better error message for 1.2, and we can look at reworking the call if we decide we want the feature more globally.
If you call
$this->restrictTo(array('json', 'html'));
in a constructor, you get the following error:I'm probably using
restrictTo()
in the wrong context, but even so presto should throw a better error here.Presto errors on this line: