lib/sensu/api/http_handler.rb
def route_request
        if @http_request_method == OPTIONS_METHOD
          respond
        else
          route_method = determine_route_method
          if route_method
            send(route_method)
          else
            allowed_http_methods = allowed_http_methods?
            if allowed_http_methods.empty?
              not_found!
            else
              method_not_allowed!(allowed_http_methods)
            end
          end
        end
      end
# Route the HTTP request. OPTIONS HTTP requests will always
# return a `200` with no response content. This method uses
# `determine_route_method()` to determine the symbolized route
# method to send/call. If a route method does not exist for the
# HTTP request method and URI, this method uses
# `allowed_http_methods?()` to determine if a 404 (Not Found) or
# 405 (Method Not Allowed) HTTP response should be used.
Route the HTTP request. OPTIONS HTTP requests will always
return a `200` with no response content. This method uses
`determine_route_method()` to determine the symbolized route
method to send/call. If a route method does not exist for the
HTTP request method and URI, this method uses
`allowed_http_methods?()` to determine if a 404 (Not Found) or
405 (Method Not Allowed) HTTP response should be used.
Route the HTTP request . OPTIONS HTTP requests will always return a ` 200 ` with no response content . This method uses ` determine_route_method () ` to determine the symbolized route method to send / call . If a route method does not exist for the HTTP request method and URI this method uses ` allowed_http_methods? () ` to determine if a 404 ( Not Found ) or 405 ( Method Not Allowed ) HTTP response should be used .
def route_request
        if @http_request_method == OPTIONS_METHOD
          respond
        else
          route_method = determine_route_method
          if route_method
            send(route_method)
          else
            allowed_http_methods = allowed_http_methods?
            if allowed_http_methods.empty?
              not_found!
            else
              method_not_allowed!(allowed_http_methods)
            end
          end
        end
      end
def route_request if @http_request_method == OPTIONS_METHOD respond else route_method = determine_route_method if route_method send ( route_method ) else allowed_http_methods = allowed_http_methods? if allowed_http_methods . empty? not_found! else method_not_allowed! ( allowed_http_methods ) end end end end
Route the HTTP request.
Route the HTTP request .