Project

General

Profile

Bug #12890 ยป patch1.diff

phluid61 (Matthew Kerwin), 11/02/2016 10:02 PM

View differences:

lib/net/http.rb
begin
res = HTTPResponse.read_new(@socket)
res.decode_content = req.decode_content
end while res.kind_of?(HTTPContinue)
end while res.continue?
res.uri = req.uri
lib/net/http/response.rb
raise error_type().new(@code + ' ' + @message.dump, self)
end
# true if another response immediately follows this one
def continue?
self.class::CONTINUE
end
def error_type #:nodoc:
self.class::EXCEPTION_TYPE
end
lib/net/http/responses.rb
# :stopdoc:
class Net::HTTPUnknownResponse < Net::HTTPResponse
HAS_BODY = true
CONTINUE = false
EXCEPTION_TYPE = Net::HTTPError
end
class Net::HTTPInformation < Net::HTTPResponse # 1xx
HAS_BODY = false
CONTINUE = true
EXCEPTION_TYPE = Net::HTTPError
end
class Net::HTTPSuccess < Net::HTTPResponse # 2xx
HAS_BODY = true
CONTINUE = false
EXCEPTION_TYPE = Net::HTTPError
end
class Net::HTTPRedirection < Net::HTTPResponse # 3xx
HAS_BODY = true
CONTINUE = false
EXCEPTION_TYPE = Net::HTTPRetriableError
end
class Net::HTTPClientError < Net::HTTPResponse # 4xx
HAS_BODY = true
CONTINUE = false
EXCEPTION_TYPE = Net::HTTPServerException # for backward compatibility
end
class Net::HTTPServerError < Net::HTTPResponse # 5xx
HAS_BODY = true
CONTINUE = false
EXCEPTION_TYPE = Net::HTTPFatalError # for backward compatibility
end
......
end
class Net::HTTPSwitchProtocol < Net::HTTPInformation # 101
HAS_BODY = false
CONTINUE = false
end
# 102 - RFC 2518; removed in RFC 4918
    (1-1/1)