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)
88 88
      415 => 'Unsupported Media Type',
89 89
      416 => 'Request Range Not Satisfiable',
90 90
      417 => 'Expectation Failed',
91
      428 => 'Precondition Required',
92
      429 => 'Too Many Requests',
93
      431 => 'Request Header Fields Too Large',
91 94
      500 => 'Internal Server Error',
92 95
      501 => 'Not Implemented',
93 96
      502 => 'Bad Gateway',
94 97
      503 => 'Service Unavailable',
95 98
      504 => 'Gateway Timeout',
96
      505 => 'HTTP Version Not Supported'
99
      505 => 'HTTP Version Not Supported',
100
      511 => 'Network Authentication Required',
97 101
    }
98 102

  
99 103
    # Maps a status code to the corresponding Status class
lib/net/http/response.rb (working copy)
55 55
#       415        HTTPUnsupportedMediaType
56 56
#       416        HTTPRequestedRangeNotSatisfiable
57 57
#       417        HTTPExpectationFailed
58
#       428        HTTPPreconditionRequired
59
#       429        HTTPTooManyRequests
60
#       431        HTTPRequestHeaderFieldsTooLarge
58 61
#
59 62
#     5xx        HTTPServerError
60 63
#       500        HTTPInternalServerError
......
63 66
#       503        HTTPServiceUnavailable
64 67
#       504        HTTPGatewayTimeOut
65 68
#       505        HTTPVersionNotSupported
69
#       511        HTTPNetworkAuthenticationRequired
66 70
#
67 71
#     xxx        HTTPUnknownResponse
68 72
#
lib/net/http/responses.rb (working copy)
116 116
class Net::HTTPPreconditionFailed < Net::HTTPClientError            # 412
117 117
  HAS_BODY = true
118 118
end
119
class Net::HTTPPreconditionRequired < Net::HTTPClientError          # 428
120
  HAS_BODY = true
121
end
122
class Net::HTTPTooManyRequests < Net::HTTPClientError               # 429
123
  HAS_BODY = true
124
end
125
class Net::HTTPRequestHeaderFieldsTooLarge < Net::HTTPClientError   # 431
126
  HAS_BODY = true
127
end
128

  
119 129
class Net::HTTPRequestEntityTooLarge < Net::HTTPClientError         # 413
120 130
  HAS_BODY = true
121 131
end
......
133 143
  HAS_BODY = true
134 144
end
135 145

  
136
class Net::HTTPInternalServerError < Net::HTTPServerError   # 500
146
class Net::HTTPInternalServerError < Net::HTTPServerError           # 500
147
  HAS_BODY = true
148
end
149
class Net::HTTPNotImplemented < Net::HTTPServerError                # 501
137 150
  HAS_BODY = true
138 151
end
139
class Net::HTTPNotImplemented < Net::HTTPServerError        # 501
152
class Net::HTTPBadGateway < Net::HTTPServerError                    # 502
140 153
  HAS_BODY = true
141 154
end
142
class Net::HTTPBadGateway < Net::HTTPServerError            # 502
155
class Net::HTTPServiceUnavailable < Net::HTTPServerError            # 503
143 156
  HAS_BODY = true
144 157
end
145
class Net::HTTPServiceUnavailable < Net::HTTPServerError    # 503
158
class Net::HTTPGatewayTimeOut < Net::HTTPServerError                # 504
146 159
  HAS_BODY = true
147 160
end
148
class Net::HTTPGatewayTimeOut < Net::HTTPServerError        # 504
161
class Net::HTTPVersionNotSupported < Net::HTTPServerError           # 505
149 162
  HAS_BODY = true
150 163
end
151
class Net::HTTPVersionNotSupported < Net::HTTPServerError   # 505
164
class Net::HTTPNetworkAuthenticationRequired < Net::HTTPServerError # 511
152 165
  HAS_BODY = true
153 166
end
154 167

  
......
198 211
    '415' => Net::HTTPUnsupportedMediaType,
199 212
    '416' => Net::HTTPRequestedRangeNotSatisfiable,
200 213
    '417' => Net::HTTPExpectationFailed,
214
    '428' => Net::HTTPPreconditionRequired,
215
    '429' => Net::HTTPTooManyRequests,
216
    '431' => Net::HTTPRequestHeaderFieldsTooLarge,
201 217

  
202 218
    '500' => Net::HTTPInternalServerError,
203 219
    '501' => Net::HTTPNotImplemented,
204 220
    '502' => Net::HTTPBadGateway,
205 221
    '503' => Net::HTTPServiceUnavailable,
206 222
    '504' => Net::HTTPGatewayTimeOut,
207
    '505' => Net::HTTPVersionNotSupported
223
    '505' => Net::HTTPVersionNotSupported,
224
    '511' => Net::HTTPNetworkAuthenticationRequired,
208 225
  }
209 226
end
210 227

  
lib/net/http.rb (working copy)
347 347
  #   HTTPUnsupportedMediaType::            415
348 348
  #   HTTPRequestedRangeNotSatisfiable::    416
349 349
  #   HTTPExpectationFailed::               417
350
  #   HTTPPreconditionRequired::            428
351
  #   HTTPTooManyRequests::                 429
352
  #   HTTPRequestHeaderFieldsTooLarge::     431
350 353
  # HTTPServerError::                    5xx
351 354
  #   HTTPInternalServerError::             500
352 355
  #   HTTPNotImplemented::                  501
......
354 357
  #   HTTPServiceUnavailable::              503
355 358
  #   HTTPGatewayTimeOut::                  504
356 359
  #   HTTPVersionNotSupported::             505
360
  #   HTTPNetworkAuthenticationRequired::   511
357 361
  #
358 362
  # There is also the Net::HTTPBadResponse exception which is raised when
359 363
  # there is a protocol error.