Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote branch 'rtomayko/rack-status-codes'

  • Loading branch information...
commit 6050727d4f33c88283df4fba3ee9f1c016525219 2 parents 686d28b + fe93450
@schacon authored
Showing with 2 additions and 44 deletions.
  1. +2 −44 kidgloves.rb
View
46 kidgloves.rb
@@ -1,54 +1,12 @@
require 'socket'
require 'stringio'
+require 'rack/utils'
module Rack
module Handler
class KidGloves
attr_accessor :app
- StatusMessage = {
- 100 => 'Continue',
- 101 => 'Switching Protocols',
- 200 => 'OK',
- 201 => 'Created',
- 202 => 'Accepted',
- 203 => 'Non-Authoritative Information',
- 204 => 'No Content',
- 205 => 'Reset Content',
- 206 => 'Partial Content',
- 300 => 'Multiple Choices',
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other',
- 304 => 'Not Modified',
- 305 => 'Use Proxy',
- 307 => 'Temporary Redirect',
- 400 => 'Bad Request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Timeout',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition Failed',
- 413 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Large',
- 415 => 'Unsupported Media Type',
- 416 => 'Request Range Not Satisfiable',
- 417 => 'Expectation Failed',
- 500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Timeout',
- 505 => 'HTTP Version Not Supported'
- }
-
def self.run(app, options={}, &block)
new(app, options).listen(&block)
end
@@ -134,7 +92,7 @@ def log(message)
end
def status_message(code)
- StatusMessage[code]
+ Rack::Utils::HTTP_STATUS_CODES[code]
end
def process_request(request, input_body, socket)
Please sign in to comment.
Something went wrong with that request. Please try again.