diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-19 16:06:18 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-19 16:06:18 +0000 |
commit | 51c2d07cb094b118b0d8abc4c43073a81ade3463 (patch) | |
tree | b0fede36712407545c0532b1cb02e41780354d21 | |
parent | 99fe7f6cd50439e525f239aa06c25bad6ce71147 (diff) | |
download | ruby-51c2d07cb094b118b0d8abc4c43073a81ade3463.tar.gz |
Add more HTTP status classes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | lib/net/http/responses.rb | 10 |
2 files changed, 12 insertions, 1 deletions
@@ -76,6 +76,9 @@ with all sufficient information, see the ChangeLog file or Redmine === Stdlib updates (outstanding ones only) * Net::HTTP + * Add more HTTP status classes + +* Net::HTTP * Net::HTTP#proxy_user and Net::HTTP#proxy_pass now reflects http_proxy environment variable if the system's environment variable is multiuser safe. [Bug #12921] diff --git a/lib/net/http/responses.rb b/lib/net/http/responses.rb index 8e75f75d4f..f467df676a 100644 --- a/lib/net/http/responses.rb +++ b/lib/net/http/responses.rb @@ -1,5 +1,6 @@ # frozen_string_literal: false # :stopdoc: +# https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml class Net::HTTPUnknownResponse < Net::HTTPResponse HAS_BODY = true EXCEPTION_TYPE = Net::HTTPError @@ -169,7 +170,7 @@ end class Net::HTTPRequestHeaderFieldsTooLarge < Net::HTTPClientError # 431 - RFC 6585 HAS_BODY = true end -class Net::HTTPUnavailableForLegalReasons < Net::HTTPClientError # 451 +class Net::HTTPUnavailableForLegalReasons < Net::HTTPClientError # 451 - RFC 7725 HAS_BODY = true end # 444 No Response - Nginx @@ -217,6 +218,7 @@ class Net::HTTPResponse CODE_TO_OBJ = { '100' => Net::HTTPContinue, '101' => Net::HTTPSwitchProtocol, + '102' => Net::HTTPProcessing, '200' => Net::HTTPOK, '201' => Net::HTTPCreated, @@ -226,6 +228,7 @@ class Net::HTTPResponse '205' => Net::HTTPResetContent, '206' => Net::HTTPPartialContent, '207' => Net::HTTPMultiStatus, + '208' => Net::HTTPAlreadyReported, '226' => Net::HTTPIMUsed, '300' => Net::HTTPMultipleChoices, @@ -255,6 +258,7 @@ class Net::HTTPResponse '415' => Net::HTTPUnsupportedMediaType, '416' => Net::HTTPRequestedRangeNotSatisfiable, '417' => Net::HTTPExpectationFailed, + '421' => Net::HTTPMisdirectedRequest, '422' => Net::HTTPUnprocessableEntity, '423' => Net::HTTPLocked, '424' => Net::HTTPFailedDependency, @@ -262,6 +266,7 @@ class Net::HTTPResponse '428' => Net::HTTPPreconditionRequired, '429' => Net::HTTPTooManyRequests, '431' => Net::HTTPRequestHeaderFieldsTooLarge, + '451' => Net::HTTPUnavailableForLegalReasons, '500' => Net::HTTPInternalServerError, '501' => Net::HTTPNotImplemented, @@ -269,7 +274,10 @@ class Net::HTTPResponse '503' => Net::HTTPServiceUnavailable, '504' => Net::HTTPGatewayTimeOut, '505' => Net::HTTPVersionNotSupported, + '506' => Net::HTTPVariantAlsoNegotiates, '507' => Net::HTTPInsufficientStorage, + '508' => Net::HTTPLoopDetected, + '510' => Net::HTTPNotExtended, '511' => Net::HTTPNetworkAuthenticationRequired, } end |