module Roda::RodaPlugins::HeaderMatchers::RequestMethods
def match_accept(mimetype)
def match_accept(mimetype) if @env["HTTP_ACCEPT"].to_s.split(',').any?{|s| s.strip == mimetype} response["Content-Type"] = mimetype end end
def match_header(key)
def match_header(key) @env[key.upcase.tr("-","_")] end
def match_host(hostname)
def match_host(hostname) hostname === host end
def match_user_agent(pattern)
Match the submitted user agent to the given pattern, capturing any
def match_user_agent(pattern) if (user_agent = @env["HTTP_USER_AGENT"]) && user_agent.to_s =~ pattern @captures.concat($~[1..-1]) end end