Tip: on how to whitelist the available verbs.

While removing verbs has been discussed before, the particular mechanism discussed–modifying the verification or VerbRules of particular verbs–is more suited to disallowing particular verbs rather than only allowing a restricted set of verbs.

The solution for this problem is to modify the beforeAction method of the Action class to check whether or not the verb is on the allowed list and handle the response if not.

This may be all too obvious to some, but alas I only realised this after first modifying the checkAction method, which was fruitless since derived classes override that without using inherit.

4 Likes