From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.204.72.79 with SMTP id l15cs470953bkj; Thu, 6 Aug 2009 15:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.142.73.11 as permitted sender) client-ip=10.142.73.11; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.142.73.11 as permitted sender) smtp.mail=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com; dkim=pass header.i=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com Received: from mr.google.com ([10.142.73.11]) by 10.142.73.11 with SMTP id v11mr255010wfa.18.1249598293031 (num_hops = 1); Thu, 06 Aug 2009 15:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received-spf:authentication-results:received:date :from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=55pkHriNnPxGUHzCaBoas0mCoOIgl5U5ojhx5C0BBj0=; b=0vNIYzPAts3F+GhvlRDPxm74jBnE9z5dguU1aCfTOI6Z34CuQBUM88Oj7SfVWjbiOk gjTUvl+tPEjmJeT3K7e4S50MBlixj3oxU/88TLl+D3HiIk7r9xVOdwMdTZtf7gTUfQ++ 8kQFxH6xACwmrEfZ2bfCkUzNWwodmWBR466S0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results:date :from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; b=2WRk2xGr+RMhgQexHMVpk+VRm0514Q8/fkE43sryImDW2u3emhH/qc9vpl0zQNiTiZ UiB1QrdfdajblXGJFNgVWHFI1dMD/pSlOyL48ySENCqcH0XSDZSSDr9A6TI0qGgqpjrT 2osmiummOvwxDjtVtYkkekVxItit0LSsZ7uxc= Received: by 10.142.73.11 with SMTP id v11mr45046wfa.18.1249598292689; Thu, 06 Aug 2009 15:38:12 -0700 (PDT) Received: by 10.106.139.12 with SMTP id m12gr1561prd.0; Thu, 06 Aug 2009 15:38:04 -0700 (PDT) X-Sender: normalperson@yhbt.net X-Apparently-To: rack-devel@googlegroups.com Received: by 10.141.15.11 with SMTP id s11mr318072rvi.10.1249598283585; Thu, 06 Aug 2009 15:38:03 -0700 (PDT) Return-Path: Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by gmr-mx.google.com with ESMTP id 21si52162pzk.0.2009.08.06.15.38.03; Thu, 06 Aug 2009 15:38:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) client-ip=64.71.152.64; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) smtp.mail=normalperson@yhbt.net Received: from localhost (unknown [12.186.229.34]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPSA id DF03C1F4E8; Thu, 6 Aug 2009 22:38:02 +0000 (UTC) Date: Thu, 6 Aug 2009 15:38:02 -0700 From: Eric Wong To: rack-devel@googlegroups.com Subject: [PATCH] Update Rack::Utils::HTTP_STATUS_CODES hash Message-ID: <20090806223802.GA15489@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Reply-To: rack-devel@googlegroups.com Sender: rack-devel@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rack-devel@googlegroups.com; contact rack-devel+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rack-devel@googlegroups.com X-BeenThere: rack-devel@googlegroups.com This adds the following status code lookups for the 102, 207, 226, 306, 422, 423, 424, 426, 506, 507, and 510 status codes. This was done programatically using the following command: curl -s http://www.iana.org/assignments/http-status-codes | \ ruby -ane 'm = /^(\d{3}) +(\S[^\[(]+)/.match($_) and puts " #{m[1]} => \x27#{m[2].strip}\x27,"' Signed-off-by: Eric Wong --- Ticket: http://rack.lighthouseapp.com/projects/22435-rack/tickets/70 Pull: git://git.bogomips.org/rack.git lib/rack/utils.rb | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb index 55f01f3..74303ef 100644 --- a/lib/rack/utils.rb +++ b/lib/rack/utils.rb @@ -318,10 +318,14 @@ module Rack end # Every standard HTTP code mapped to the appropriate message. - # Stolen from Mongrel. + # Generated with: + # curl -s http://www.iana.org/assignments/http-status-codes | \ + # ruby -ane 'm = /^(\d{3}) +(\S[^\[(]+)/.match($_) and + # puts " #{m[1]} => \x27#{m[2].strip}x27,"' HTTP_STATUS_CODES = { 100 => 'Continue', 101 => 'Switching Protocols', + 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', @@ -329,12 +333,15 @@ module Rack 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', + 207 => 'Multi-Status', + 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', + 306 => 'Reserved', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', @@ -350,16 +357,23 @@ module Rack 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Large', + 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 426 => 'Upgrade Required', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported' + 505 => 'HTTP Version Not Supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 510 => 'Not Extended', } # Responses with HTTP status codes that should not have an entity body -- Eric Wong