class Rack::Lint::Wrapper
def check_rack_protocol_header(status, headers)
# ==== The +rack.protocol+ Header
#
def check_rack_protocol_header(status, headers) ## If the +rack.protocol+ header is present, it must be a +String+, and ## must be one of the values from the +rack.protocol+ array from the ## environment. protocol = headers['rack.protocol'] if protocol request_protocols = @env['rack.protocol'] if request_protocols.nil? raise LintError, "rack.protocol header is #{protocol.inspect}, but rack.protocol was not set in request!" elsif !request_protocols.include?(protocol) raise LintError, "rack.protocol header is #{protocol.inspect}, but should be one of #{request_protocols.inspect} from the request!" end end end