vendor/plugins/assert_request/lib/protocol_rules.rb
# Check the given request protocol.Raises an exception if it is invalid.
Check the given request protocol.Raises an exception if it is invalid.
Check the given request protocol . Raises an exception if it is invalid .
def validate(protocol)
      protocol = protocol.sub(/:\/\/$/, '').to_sym
      requirements = @requirements.empty? ? [:http] : @requirements
      unless requirements.include? protocol
        raise RequestError, "protocol #{protocol} is not permitted"
      end      
    end
def validate ( protocol ) protocol = protocol . sub ( / : \/ \/ $ / , '' ) . to_sym requirements = @requirements . empty? ? [ :http ] : @requirements unless requirements . include? protocol raise RequestError , "protocol #{protocol} is not permitted" end end
Check the given request protocol.Raises an exception if it is invalid.
Check the given request protocol . Raises an exception if it is invalid .
# method.protocol leaves a trailing :// on its results. # If no requirements were specified, presume HTTP.
protocol