Fix previous commit.
Validate the methods.

This is to prevent getting arbitrary methods.