single instance to speed up connection. [Feature #5341]
* NEWS: ditto
* test/net/http/test_https.rb: Tests for #5341
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/http.rb (Net::HTTP.new): set default_port if proxy port is
not given.
* lib/net/http.rb (Net::HTTP#initialize): ditto.
* lib/net/http.rb (Net::HTTP#proxy?): return true or false.
* lib/net/http.rb (Net::HTTP#proxy_address): check proxy_uri is not nil.
* lib/net/http.rb (Net::HTTP#proxy_port): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
proxies from the environment. A proxy may also be specified as
before.
Net::HTTP::Proxy still creates anonymous classes, but these classes
are only used to store configuration information. When an HTTP
instance is created the configuration is now copied.
Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP
[Feature #6546]
* lib/open-uri.rb: Moved URI::Generic#find_proxy to uri/generic.
* lib/uri/generic.rb: Imported find_proxy from open-uri.
* test/open-uri/test_open-uri.rb: Moved proxy-discovery tests to URI.
* test/uri/test_generic.rb: Imported proxy-discovery tests from
open-uri.
* test/net/http/test_http.rb: Added tests for proxy behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
deflate-encoded response bodies. [Feature #6942]
* lib/net/http/generic_request.rb: Automatically accept gzip and
deflate content-encoding for requests. [Feature #6494]
* lib/net/http/request.rb: Updated documentation for #6494.
* lib/net/http.rb: Updated documentation for #6492 and #6494, removed
Content-Encoding handling now present in Net::HTTPResponse.
* test/net/http/test_httpresponse.rb: Tests for #6492
* test/net/http/test_http_request.rb: Tests for #6494
* test/open-uri/test_open-uri.rb (test_content_encoding): Updated test
for automatic content-encoding handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
cannot cross between network interfaces on Windows, so skip this test
until we find better test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Net::HTTPResponses and put a test case for the previous bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
HTTP Range request. Old one can't parse invalid specs and multiple
specs correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
OpenTimeout. ReadTimeout is now raised by rbuf_fill instead of
Timeout::Error to help users distinguish what type of timeout
occurred. [ruby-trunk - Feature #6088]
* lib/net/pop.rb (module Net): Updated documentation for ReadTimeout
and OpenTimeout.
* lib/net/http.rb (module Net): ditto
* lib/net/smtp.rb (module Net): ditto
* lib/net/telnet.rb (module Net): Net::ReadTimeout is now raised in
waitfor to match Net::Protocol.
* test/net/http/test_http.rb: Updated Timeout::Error expectation to
Net::ReadTimeout.
* test/net/ftp/test_ftp.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
upon EOFError or Errno::ECONNRESET where count is reset to 0.
* test/net/http/test_http.rb (class TestNetHTTPKeepAlive): Test for
above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(HTTPSProxyTest#test_https_proxy_authentication):
add workaround to avoid to hang up without openssl.
see #5786
* test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
request automatically. [ruby-dev:45030] [Bug #5790]
[ruby-core:41821] [Bug #5813]
* lib/net/http.rb (Net::HTTP#keep_alive_timeout=): added to specify
the second to reconnect the TCP connection on Keep-Alive.
The default value is 2 second because current servers uses 2 sec.
http://ftp-admin.blogspot.com/2009/09/keepalivetimeout2.html
* lib/net/http.rb (Net::HTTP#begin_transport): reconnect TCP
connection on keep-alive timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
If you connect to localhost, you should listen localhost.
* test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the given URI to post. See #655.
* test/net/http/test_http.rb, test/net/http/utils.rb: Test it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
server returning '100 continue' response befor sending HTTP request
body. See NEWS for more detail. See #3622.
Original patch is made by Eric Hodel <drbrain@segment7.net>.
* test/net/http/test_http.rb: test it.
* NEWS: Add new feature.
On my env (Ubuntu 11.04 64bit),
9510 tests, 2203824 assertions, 0 failures, 0 errors, 29 skips
->
9514 tests, 2203836 assertions, 0 failures, 0 errors, 29 skips
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
both application/x-www-form-urlencoded and multipart/form-data.
There is a similar API, Net::HTTPRequest#set_form_data, but
to keep its compatibility this is newly added. [ruby-dev:42729]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
guaranteed to be resolved as 127.0.0.1. But a SSL
certificate needs a socket to listen on a specific address
where a CN resolves to. On situations where localhost is
not 127.0.0.1, these tests are not possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Added a Net::HTTP::Patch class which expects a message body
and response body. It recycles the post method into a patch one,
that will send the encoded representation to the server.
Summarizing, a new class has been created, the post method
extracted into send_entity, including a new argument,
which defines which class to use (Post or Patch) and
finally a patch method was created. [ruby-core:30426]
Patched by Guilherme Silveira
<guilherme.silveira AT caelum.com.br>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
last newline of chunk. [ruby-core:29229]
* test/net/http/utils.rb: add an option for chunked response test.
* test/net/http/test_http.rb: add tests for chunked response.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e