Headers
Headers
# File lib/rack/response.rb, line 116 def client_error?; @status >= 400 && @status < 500; end
# File lib/rack/response.rb, line 137 def content_length cl = headers["Content-Length"] cl ? cl.to_i : cl end
# File lib/rack/response.rb, line 133 def content_type headers["Content-Type"] end
# File lib/rack/response.rb, line 124 def empty?; [201, 204, 304].include? @status; end
# File lib/rack/response.rb, line 120 def forbidden?; @status == 403; end
# File lib/rack/response.rb, line 129 def include?(header) !!headers[header] end
# File lib/rack/response.rb, line 113 def informational?; @status >= 100 && @status < 200; end
# File lib/rack/response.rb, line 111 def invalid?; @status < 100 || @status >= 600; end
# File lib/rack/response.rb, line 142 def location headers["Location"] end
# File lib/rack/response.rb, line 121 def not_found?; @status == 404; end
# File lib/rack/response.rb, line 119 def ok?; @status == 200; end
# File lib/rack/response.rb, line 123 def redirect?; [301, 302, 303, 307].include? @status; end
# File lib/rack/response.rb, line 115 def redirection?; @status >= 300 && @status < 400; end
# File lib/rack/response.rb, line 117 def server_error?; @status >= 500 && @status < 600; end
# File lib/rack/response.rb, line 114 def successful?; @status >= 200 && @status < 300; end