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
because transfercmd may fail and return nil.
* lib/net/ftp.rb (Net::FTP#retrlines): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
conn.print may raise EPIPE because ftp.retrbinary closes the connection
because of read_timeout. but the exact result varies from the situation
like platform, timing, and so on.
it may raise ECONNRESET, ECONNABORTED, EOFError, or nothing raised.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35749 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
a little before closing socket because if the client call
Net::FTP#getmultiline the socket is suddenly closed by the server in
the getline loop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
connection is closed without a greeting response.
[ruby-core:40938] [Bug #5616]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35055 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
default_tls_port, default_ssl_port, default_imaps_port):
added methods for consistency with Net::POP.
based on the patch by art lussos. [ruby-core:38997] [Bug #5198]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
connection is closed. based on the patch by Hugo Barauna.
[Bug #5190] [ruby-core:38930]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
based on the patch by art lussos. [Bug #5163] [ruby-core:38820]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33001 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
the Yahoo IMAP server correctly. patched by Mark Nadig. [Bug #4509]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32114 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
* test/net/imap/server.crt: signed again because CA cert was expired.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30304 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
extension by Apple and Google. patch by Geoff Youngs.
[ruby-core:33521]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30108 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
resolve to "127.0.0.1". On my machine it is "::1" instead.
The problem is, you have to connect to the imaps server via
the canonical name written in a server certificate, and that
of the server.cert is "localhost". So you have to listen to
the address of what "localhost" resolves to. I think this
situation cannot be resolved in a handy manner because the
test "test_imaps_post_connection_check" is actually
expecting to connect to a server via an address other than
the CN. On my machine several assertions won't pass because
the test cannot connect to the server.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29257 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
level 1.
* lib/net/imap.rb (max_flag_count=): new methods to set the max
number of flags interned to symbols.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
from Eric Hodel.
* test/net/imap/test_imap.rb (setup, teardown): turn on
Socket.do_not_reverse_lookup in tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
text. [ruby-core:24194]
* lib/net/imap.rb (idle, idle_done): new methods for the IMAP4 IDLE
command (RFC 2177). Thanks, Eric Hodel.
* lib/net/imap.rb (format_date, format_datetime): new method to
format IMAP-style date/datetime. Thanks, Eric Hodel.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
OpenSSL::SSL::SSLContext.build instead of SSLContext.new (default
verify mode is now OpenSSL::SSL::VERIFY_PEER).
* lib/net/https.rb: SSL parameters are defined by attr_accessor.
* test/net/http/test_https.rb: add test for HTTPS features.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/net/http/test_http.rb. and start HTTP server in each test case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/http.rb (Net::HTTPHeader#content_type): should return nil when there's no Content-Type.
* lib/net/http.rb (Net::HTTPHeader#sub_type): should return nil when there's no sub Content-Type (e.g. "Content-Type: text").
* lib/net/http.rb (Net::HTTPHeader#type_params): wrongly failed when there's no Content-Type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/http.rb: new method Net::HTTPHeader#set_form_data and its alias #form_data=.
* lib/net/http.rb: Net::HTTPHeader#add_header -> add_field (adjustted to Ruby 1.8).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e