Project

General

Profile

Feature #6480 » net.http.rfc6585.patch

Correct updated patch - drbrain (Eric Hodel), 05/23/2012 07:36 AM

View differences:

lib/webrick/httpstatus.rb (working copy)
415 => 'Unsupported Media Type',
416 => 'Request Range Not Satisfiable',
417 => 'Expectation Failed',
428 => 'Precondition Required',
429 => 'Too Many Requests',
431 => 'Request Header Fields Too Large',
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',
511 => 'Network Authentication Required',
}
# Maps a status code to the corresponding Status class
lib/net/http/response.rb (working copy)
# 415 HTTPUnsupportedMediaType
# 416 HTTPRequestedRangeNotSatisfiable
# 417 HTTPExpectationFailed
# 428 HTTPPreconditionRequired
# 429 HTTPTooManyRequests
# 431 HTTPRequestHeaderFieldsTooLarge
#
# 5xx HTTPServerError
# 500 HTTPInternalServerError
......
# 503 HTTPServiceUnavailable
# 504 HTTPGatewayTimeOut
# 505 HTTPVersionNotSupported
# 511 HTTPNetworkAuthenticationRequired
#
# xxx HTTPUnknownResponse
#
lib/net/http/responses.rb (working copy)
class Net::HTTPPreconditionFailed < Net::HTTPClientError # 412
HAS_BODY = true
end
class Net::HTTPPreconditionRequired < Net::HTTPClientError # 428
HAS_BODY = true
end
class Net::HTTPTooManyRequests < Net::HTTPClientError # 429
HAS_BODY = true
end
class Net::HTTPRequestHeaderFieldsTooLarge < Net::HTTPClientError # 431
HAS_BODY = true
end
class Net::HTTPRequestEntityTooLarge < Net::HTTPClientError # 413
HAS_BODY = true
end
......
HAS_BODY = true
end
class Net::HTTPInternalServerError < Net::HTTPServerError # 500
class Net::HTTPInternalServerError < Net::HTTPServerError # 500
HAS_BODY = true
end
class Net::HTTPNotImplemented < Net::HTTPServerError # 501
HAS_BODY = true
end
class Net::HTTPNotImplemented < Net::HTTPServerError # 501
class Net::HTTPBadGateway < Net::HTTPServerError # 502
HAS_BODY = true
end
class Net::HTTPBadGateway < Net::HTTPServerError # 502
class Net::HTTPServiceUnavailable < Net::HTTPServerError # 503
HAS_BODY = true
end
class Net::HTTPServiceUnavailable < Net::HTTPServerError # 503
class Net::HTTPGatewayTimeOut < Net::HTTPServerError # 504
HAS_BODY = true
end
class Net::HTTPGatewayTimeOut < Net::HTTPServerError # 504
class Net::HTTPVersionNotSupported < Net::HTTPServerError # 505
HAS_BODY = true
end
class Net::HTTPVersionNotSupported < Net::HTTPServerError # 505
class Net::HTTPNetworkAuthenticationRequired < Net::HTTPServerError # 511
HAS_BODY = true
end
......
'415' => Net::HTTPUnsupportedMediaType,
'416' => Net::HTTPRequestedRangeNotSatisfiable,
'417' => Net::HTTPExpectationFailed,
'428' => Net::HTTPPreconditionRequired,
'429' => Net::HTTPTooManyRequests,
'431' => Net::HTTPRequestHeaderFieldsTooLarge,
'500' => Net::HTTPInternalServerError,
'501' => Net::HTTPNotImplemented,
'502' => Net::HTTPBadGateway,
'503' => Net::HTTPServiceUnavailable,
'504' => Net::HTTPGatewayTimeOut,
'505' => Net::HTTPVersionNotSupported
'505' => Net::HTTPVersionNotSupported,
'511' => Net::HTTPNetworkAuthenticationRequired,
}
end
lib/net/http.rb (working copy)
# HTTPUnsupportedMediaType:: 415
# HTTPRequestedRangeNotSatisfiable:: 416
# HTTPExpectationFailed:: 417
# HTTPPreconditionRequired:: 428
# HTTPTooManyRequests:: 429
# HTTPRequestHeaderFieldsTooLarge:: 431
# HTTPServerError:: 5xx
# HTTPInternalServerError:: 500
# HTTPNotImplemented:: 501
......
# HTTPServiceUnavailable:: 503
# HTTPGatewayTimeOut:: 504
# HTTPVersionNotSupported:: 505
# HTTPNetworkAuthenticationRequired:: 511
#
# There is also the Net::HTTPBadResponse exception which is raised when
# there is a protocol error.
(2-2/2)