Commit graph

363 commits

Author SHA1 Message Date
Hiroshi SHIBATA
e3a19b8a43 [ruby/net-http] Bump up 0.4.0
4be99c204c
2023-11-06 08:23:09 +00:00
Hiroshi SHIBATA
66d266244c [ruby/net-http] Removed obsolated Revision constant
c1c5638014
2023-11-06 08:22:39 +00:00
Christian van Rensen
14fa5e39d7 [ruby/net-http] fix no_proxy behaviour
f4951dc42a
2023-10-30 09:27:06 +00:00
0x1eef
e77c766b7a [ruby/net-http] No longer neccessary to call String#freeze on string literals.
See #144

5a986c13d3
2023-09-19 01:32:18 +00:00
Josh Nichols
af67ced3b0 [ruby/net-http] Update lib/net/http.rb
@natematykiewicz's suggestion to avoid another string allocation

4a22c42338

Co-authored-by: Nate Matykiewicz <natematykiewicz@gmail.com>
2023-08-16 01:40:13 +00:00
Josh Nichols
70da92cdf7 [ruby/net-http] Fix on 2.7
5194fd541e
2023-08-16 01:40:10 +00:00
Josh Nichols
4d21134f3f [ruby/net-http] freeze rest of lib
455a74734a
2023-08-16 01:40:09 +00:00
Hiroshi SHIBATA
030f39822a [ruby/net-http] Re-apply
d22ca54904 after
testing

7ac7401a9c
2023-03-07 01:35:20 +00:00
Nobuyoshi Nakada
fd0a5659ca [ruby/net-http] Test building packages
Also revert commit d22ca54904 "Replaced
non-ascii charactor. It fails version detection at `net-http.gemspec`."

fbeb247d93
2023-03-06 13:26:34 +00:00
Hiroshi SHIBATA
62e2b61607
Replaced non-ascii charactor. It fails version detection at net-http.gemspec.
>#   Returns the X509 certificate chain for the session<E2><80><99>s socket peer.
2023-03-06 14:50:53 +09:00
Burdette Lamar
1b4c1492c1 [ruby/net-http] [DOC] What's Here for Net:HTTP
(https://github.com/ruby/net-http/pull/128)

39e70f0f9b
2023-03-05 19:06:37 +00:00
Burdette Lamar
6e6992e5db [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/127)

07b2b88ef5
2023-02-26 13:37:15 +00:00
Burdette Lamar
05f016cdad [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/126)

4700d0660b
2023-02-24 19:09:06 +00:00
Burdette Lamar
7c47c2617a [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/125)

2ea20380fc
2023-02-23 16:51:58 +00:00
Burdette Lamar
4edb2a29f6 [ruby/net-http] [DOC] Enhanced RDoc for Net:HTTP
(https://github.com/ruby/net-http/pull/124)

aaf26b21d6
2023-02-22 13:58:36 +00:00
Burdette Lamar
899fad907c [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/123)

220ff3f741
2023-02-20 21:57:16 +00:00
Burdette Lamar
a49bc73e1f [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/122)

06f79cda87
2023-02-16 21:52:10 +00:00
Burdette Lamar
847a0df058 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP#get
(https://github.com/ruby/net-http/pull/121)

51b9af1eed
2023-02-15 15:00:34 +00:00
BurdetteLamar
bc6e587e86 [ruby/net-http] Enhanced RDoc for Compression
cff88acd70
2023-02-13 13:04:33 +00:00
BurdetteLamar
2c7fe9c0a6 [ruby/net-http] Enhanced RDoc for Net::HTTP
e65a3d9f11
2023-02-07 16:01:04 +00:00
Burdette Lamar
a641f6422c [ruby/net-http] [DOC] Reorganize doc for proxy server
(https://github.com/ruby/net-http/pull/117)

f8b6b76cba
2023-02-07 14:53:38 +00:00
git
06195e7603 * remove trailing spaces. [ci skip] 2023-02-04 18:06:18 +00:00
Burdette Lamar
6db79aefec [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/116)

22c0d34002
2023-02-04 18:06:06 +00:00
Burdette Lamar
faa4c2279a [ruby/net-http] [DOC] Enhanced RDoc for write_timeout
(https://github.com/ruby/net-http/pull/115)

6da39b0461
2023-02-03 14:33:53 +00:00
BurdetteLamar
3ebc80314c [ruby/net-http] Redirection revision
9a4e2d3a2a
2023-01-31 21:01:04 +00:00
Burdette Lamar
d92289f633 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/110)

b098caa5e4
2023-01-31 14:18:50 +00:00
Hiroshi SHIBATA
fe7d4eed25
Manually merged https://github.com/ruby/net-http/pull/106
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Co-authored-by: BurdetteLamar <burdettelamar@yahoo.com>
2023-01-31 13:14:05 +09:00
Hiroshi SHIBATA
08d21b4bd2
[ruby/net-http] Bump version to 0.3.2
b8bdb7248e
2022-12-19 10:50:21 +09:00
BurdetteLamar
d5eafaed81 [ruby/net-http] Enhanced RDoc for Net::HTTP
da626e4e42
2022-12-15 21:33:19 +00:00
Burdette Lamar
3e5f8b2af3 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/89)

86b84eb307
2022-12-14 13:55:06 +00:00
Burdette Lamar
f1cdc129d4 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/85)

9d9040fb79
2022-12-11 22:26:18 +00:00
Peter Zhu
9d4483f24d [ruby/net-http] [DOC] Fix call-seq for Net::HTTP.start
The lack of a newline between the call-seq and the documentation was
causing the documentation to be parsed as a call-seq.

1a212e2065
2022-12-06 14:27:15 +00:00
Hiroshi SHIBATA
9e114338b9 [ruby/net-http] Bump version to 0.3.1
09a9ea163a
2022-12-05 06:42:56 +00:00
BurdetteLamar
909ea6b60d [ruby/net-http] About the Examples moved to separate file
0512b5bfc9
2022-11-19 15:33:28 +00:00
BurdetteLamar
dbb902fc91 [ruby/net-http] Enhanced RDoc for Net::HTTP
4444e8cea4
2022-11-19 10:17:54 -05:00
BurdetteLamar
951eabdcf2 [ruby/net-http] Enhanced RDoc for Net::HTTP
6b30c5310b
2022-11-19 10:17:53 -05:00
Burdette Lamar
a48e01ccba [ruby/net-http] Update lib/net/http.rb
16d042fad6

Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2022-11-11 17:05:29 +00:00
BurdetteLamar
4d9ada223b [ruby/net-http] Prettify class hierarchies in Net::HTTP
4a5732e210
2022-11-11 17:05:28 +00:00
Hiroshi SHIBATA
c5f5403f6e [ruby/net-http] Bump version to 0.3.0 2022-10-24 05:45:44 +00:00
Hiroshi SHIBATA
f88bff7705 [ruby/net-http] Revert "Replace Timeout.timeout in Net:HTTP#connect"
This reverts commit 753cae3bbc.

98caa38204
2022-10-21 12:39:52 +00:00
Jeremy Evans
cd77e71bba [ruby/net-http] Remove ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE
This list is out of date.  At least OpenBSD since 2013 does not
allow one user to read the environment variables of a process
run by another user.

While we could try to keep the list updated, I think it's a bad
idea to not use the user/password from the environment, even if
another user on the system could read it.  If http_proxy exists
in the environment, and other users can read it, it doesn't
make it more secure for Ruby to ignore it.  You could argue that
it encourages poor security practices, but net/http should provide
mechanism, not policy.

Fixes [Bug #18908]

1e4585153d
2022-09-28 17:26:03 +09:00
Hiroshi SHIBATA
ecf32dbfc0 [ruby/net-http] Bump version to 0.2.2
992d07cb41
2022-05-09 18:20:31 +09:00
Charles Oliver Nutter
cd2613b6a4 [ruby/net-http] Bump version to 0.2.1.pre1
0017cc64c0
2022-04-28 05:56:26 +09:00
Karol Bucek
cf73cf5981 [ruby/net-http] Feature detect to make net/http usable with JRuby
Handle missing session_new_cb= and do not call
session_cache_mode=, as JRuby SSL does not support
these methods.

3237ef4d8c
2022-04-20 13:01:08 +09:00
Jeremy Evans
90ccc5674a [ruby/net-http] Add ignore_eof access to HTTP and HTTPResponse
The ignore_eof setting on HTTPResponse makes it so an EOFError is
raised when reading bodies with a defined Content-Length, if the
body read was truncated due to the socket be closed.

The ignore_eof setting on HTTP sets the values used in responses
that are created by the object.

For backwards compatibility, the default is for both settings is
true.  However, unless you are specifically tested for and handling
truncated responses, it's a good idea to set ignore_eof to false so
that errors are raised for truncated responses, instead of those
errors silently being ignored.

Fixes [Bug #14972]

4d47e34995
2022-04-20 10:22:06 +09:00
Jeremy Evans
ebb4378237 [ruby/net-http] Add HTTP#response_body_encoding for setting response body encoding
This allows for the ability to opt-in to a method to set the
encoding of response bodies.  By setting the accessor to a String
or Encoding instance, it will use the specified encoding.
Setting the value of true will try to detect the encoding of the
response body, either using the Content-Type header (assuming it
specifies charset) or by scanning for a <meta> tag in the document
that specifies the encoding.  The default is false in which case
no forcing of encoding will be done (same as before the patch).

Implements [Feature #2567]
Implements [Feature #15517]

6233e6b7c1

Co-authored-by: Yui Naruse <naruse@ruby-lang.org>
2022-04-12 00:17:34 +09:00
Jeremy Evans
7529c53891 [ruby/net-http] Do not set SNI hostname if connecting to IP address
RFC 6066, section 3, explicitly disallows the use of an IP address
as an SNI server name.  So check if the connection is being made
to an IP address using the resolv regexps, and do not set an SNI
hostname in that case.

Recent changes to LibreSSL make it more strictly follow RFC 6066,
resulting an s.hostname= raising an error if passed an IP address.
When such verions of LibreSSL are used, this change not only fixes
the net/http tests, it also fixes tests for webrick and open-uri,
which both make SSL connections to 127.0.0.1 using net/http in
their tests.

Avoid warning in the openssl extension by unsetting
@ssl_context.verify_hostname if connecting to an IP address.
Make changes so that the post_connection_check still happens
when connecting to an IP address, which is necessary to keep
checking that the certificate returned includes the IP address,
which one of the tests depends on.

Revert the previous change that modified the regexp used for
checking the error message.

fa68e64bee
2022-02-03 05:10:21 +09:00
Brandon Weaver
ac1bb6b510 [ruby/net-http] Rename D to debug in Net::HTTP
Renames `D` to `debug` in `Net::HTTP` and introduces an alias for
backwards compatibility. This was done for readability reasons, in that
`D` did not clearly reflect what the method was doing and can cause some
confusion.

582d6e87d6
2022-01-17 10:17:23 +09:00
Kazuhiro NISHIYAMA
5757696e07
res.response_body_permitted? is not defined
`response_body_permitted?` is a method of request.
2022-01-05 16:20:11 +09:00
Kazuki Yamaguchi
5f2c4e344d [ruby/net-http] Reset keep_alive timer on new connection
The last_communicated timestamp is for HTTP persistent connection, to
decide whether the current TCP connection may be reused for the
subsequent requests or not. Naturally, the timer must be reset if the
connection is recreated since it is no longer relevant.

0a013de42d
2021-11-04 20:44:04 +09:00