This patch unifies logic related to the supported HTTP verbs. HttpRouter::Route::VALID_HTTP_VERBS is now the canonical list of supported verbs. Two verbs were added that were not supported at all before: LINK and UNLINK.
The route helpers in HttpRouter and HttpRouter::RouteHelper are now dynamically generated from the constant list of valid HTTP verbs, as they were previously inconsistent with each other as to which verbs had helper methods. GET is still defined normally in both objects, since it's a special case that responds to both GET and HEAD.
Additionally, RouteHelper#add_request_method will now raise a clearer exception when an unsupported method is used.
This patch unifies logic related to the supported HTTP verbs.
HttpRouter::Route::VALID_HTTP_VERBS
is now the canonical list of supported verbs. Two verbs were added that were not supported at all before: LINK and UNLINK.The route helpers in
HttpRouter
andHttpRouter::RouteHelper
are now dynamically generated from the constant list of valid HTTP verbs, as they were previously inconsistent with each other as to which verbs had helper methods. GET is still defined normally in both objects, since it's a special case that responds to both GET and HEAD.Additionally,
RouteHelper#add_request_method
will now raise a clearer exception when an unsupported method is used.