Commit graph

142 commits

Author SHA1 Message Date
BurdetteLamar
3e5a77f1ae [ruby/net-http] Remarks on inclusions
dfd060c583
2023-02-02 14:16:59 +00:00
Burdette Lamar
5a9e2f142d [ruby/net-http] [DOC] Enhanced RDoc for HTTPGenericRequest
(https://github.com/ruby/net-http/pull/113)

14c8405702
2023-02-02 14:03:19 +00:00
BurdetteLamar
8250b46794 [ruby/net-http] Correct doc error
dc006d8419
2023-01-28 21:41:15 +00:00
Burdette Lamar
401aa9ddd1 [ruby/net-http] [DOC] Header doc
(https://github.com/ruby/net-http/pull/104)

3308362d9b
2023-01-19 18:58:40 +00:00
Burdette Lamar
308942920f [ruby/net-http] [DOC] Enhanced RDoc for set_form
(https://github.com/ruby/net-http/pull/103)

f6506ff889
2023-01-18 21:03:58 +00:00
BurdetteLamar
44b7fd8d4f [ruby/net-http] Enhanced RDoc for HTTPHeader
6a282eccdd
2023-01-01 15:02:14 +00:00
BurdetteLamar
8f678d61a5 [ruby/net-http] Adding links to references
1c8151aaf3
2022-12-26 22:17:18 +00:00
Burdette Lamar
8c8645f578 [ruby/net-http] [DOC] Adding links to references
(https://github.com/ruby/net-http/pull/97)

768115167a
2022-12-26 15:09:21 +09:00
BurdetteLamar
35aba09e7f [ruby/net-http] Adding links to references
b85530e6b8
2022-12-26 15:09:21 +09:00
Hiroshi SHIBATA
cd6c7613f3
Apply the accidental commits again before Ruby 3.2.
Reverts the following commits:

  eb8d4d7b51
  edb83dc3a2
  d40064d184
2022-12-26 12:07:42 +09:00
Hiroshi SHIBATA
eb8d4d7b51
Revert the additional changes from net-http-0.3.2 2022-12-23 19:36:43 +09:00
BurdetteLamar
172dc98c94 [ruby/net-http] Adding links to references
71bae5c0fe
2022-12-21 09:17:19 -05:00
BurdetteLamar
276b84f8ed [ruby/net-http] Adding links to references
e4df80f299
2022-12-21 09:17:19 -05:00
BurdetteLamar
86f0128efe [ruby/net-http] Adding links to references
df5a554fa8
2022-12-21 09:17:18 -05:00
BurdetteLamar
ede7c035d5 [ruby/net-http] Adding links to references
6dfe6f411a
2022-12-18 15:37:45 +00:00
Burdette Lamar
55f56eb66e [ruby/net-http] [DOC] New doc for responses classes
(https://github.com/ruby/net-http/pull/91)

d394404402
2022-12-14 22:13:28 +00:00
Burdette Lamar
d2b87456f0 [ruby/net-http] [DOC] Correct formatting in header.rb
(https://github.com/ruby/net-http/pull/90)

d9d829ca53
2022-12-14 21:34:12 +00:00
Burdette Lamar
63f682ba11 [ruby/net-http] [DOC] Enhanced RDoc for HTTPHeader
(https://github.com/ruby/net-http/pull/88)

46e966be10
2022-12-12 19:34:21 +00:00
Burdette Lamar
e58c4f97fa [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/84)

660046386f
2022-12-04 20:22:31 +00:00
Burdette Lamar
171e94bd95 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTPHeader
(https://github.com/ruby/net-http/pull/83)

1ea5004098
2022-12-01 23:17:47 +00:00
Burdette Lamar
ee49fe5d34 [ruby/net-http] Enhanced RDoc for header Range
(https://github.com/ruby/net-http/pull/82)

a26f62a2e5
2022-11-28 23:33:15 +00:00
Burdette Lamar
b55da1cd97 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTPHeader
77c6878970
2022-11-27 00:21:49 +00:00
BurdetteLamar
5ee947314e [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
86b0514239
2022-11-23 17:12:35 +00:00
BurdetteLamar
4b32ed6e33 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
ef0ef53b0c
2022-11-23 17:12:34 +00:00
BurdetteLamar
79a9280aa5 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
0af9fb94a9
2022-11-23 17:12:33 +00:00
BurdetteLamar
c6dc126641 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
995ff356b4
2022-11-23 17:12:33 +00:00
BurdetteLamar
66be0922b7 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
e924f1205b
2022-11-23 17:12:32 +00:00
BurdetteLamar
909ea6b60d [ruby/net-http] About the Examples moved to separate file
0512b5bfc9
2022-11-19 15:33:28 +00:00
BurdetteLamar
e6162728f6 [ruby/net-http] Enhanced RDoc for Net::HTTP 2022-11-19 10:25:12 -05:00
Burdette Lamar
2047636af8 [ruby/net-http] Update lib/net/http/request.rb
e3c9011edb

Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2022-11-19 10:17:54 -05: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
Hiroshi SHIBATA
1cda414622 Raise ArgumentError with empty host url again.
Fixup dd5118f852

Co-authored-by: Koichi Sasada <ko1@atdot.net>
2022-10-13 12:32:02 +09:00
Shishir Joshi
c310691dd8 [ruby/net-http] Make Net::HTTPHeader#content_range return nil on non-byte units
* Returning nil from the `content_range` method instead of raising an
  error when the unit in the content-range header is not "bytes".

Fix https://bugs.ruby-lang.org/issues/11450

0b5030dd86

Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-06-16 23:35:27 +09:00
Nobuyoshi Nakada
2223eb082a
Revert "HTTPHeader.content_range throws error on non-byte units"
This reverts commit 63546bfc15.
2022-06-16 22:10:59 +09:00
Shishir Joshi
63546bfc15
HTTPHeader.content_range throws error on non-byte units
* Added a nil check in Net::HTTPHeader#initialize_http_header for keys in the header that do not have any value
* Returning nil from the content_range method instead of raising an error when the unit in the content-range header is not bytes
* Modified initialize_http_header to match trunk

fix [Bug #11450]
fix https://github.com/ruby/ruby/pull/1018
2022-06-16 20:16:47 +09:00
Nobuyoshi Nakada
4cf155e007 [ruby/net-http] [DOC] Get rid of a RDoc bug
RDoc overrides class name by the assigned name unexpectedly when
assigned using a qualified class path.

a7bded0407
2022-05-23 18:23:22 +09:00
Nobuyoshi Nakada
8fa9e168be [ruby/net-http] Make the recommended name formal
`HTTPServerException` is the name deprecated since years ago.

b3028fef5a
2022-05-21 00:41:54 +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
0579486f15 [ruby/net-http] Update the content-length heading when decoding bodies
Previously, the content-encoding header was removed and the body
was modified, but the content-length header was not modified,
resulting in the content-length header not matching the body
length.

Don't delete content-length before yielding inflate body, as that
causes a switch to read the entire body instead of reading in
chunks.

Fixes [Bug #16672]

58284e9710

Co-authored-by: st0012 <stan001212@gmail.com>
2022-04-14 00:11:26 +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
7648bae4c8 [ruby/net-http] Revert "Update the content-length heading when decoding bodies"
This reverts commit a7cb30124c.

This is causing errors in Ruby's CI, will revert for now and
try again after testing a fix with Ruby's CI.

7b852b1feb
2022-04-03 06:51:07 +09:00
Jeremy Evans
58adb1636b [ruby/net-http] Update the content-length heading when decoding bodies
Previously, the content-encoding header was removed and the body
was modified, but the content-length header was not modified,
resulting in the content-length header not matching the body
length.

Fixes [Bug #16672]

a7cb30124c
2022-04-02 02:49:21 +09:00
Hiroshi SHIBATA
c53bdb8ff6
Removed dependency of net-protocol. There is no plan to remove from stdlib 2022-02-21 17:10:56 +09:00
Olle Jonsson
c240ccd643 [ruby/net-http] gemspec: Drop unused directive "executables"
This gem exposes no executable files.

3b3743f6ce
2021-11-17 19:09:14 +09:00
Shohei Maeda
52ab9bbee9 [ruby/net-http] Send Accept-Encoding header on HEAD method
9d95c5e3e6
2021-11-11 17:34:00 +09:00
Nobuyoshi Nakada
3d8e1ee40f [ruby/net-http] Warn deprecated old constants
2a97b4729b
2021-11-04 20:51:51 +09:00
Nobuyoshi Nakada
b49dbe025f [ruby/net-http] Fix the typo in a constant name
dada6007bf
2021-11-04 20:51:42 +09:00
Miguel Teixeira
60b02db516 [ruby/net-http] Enforce write timeout when body_stream is used
The existing implementation of `Net::HTTP#write_timeout` relies on
`Net::BefferedIO` to trigger the `Net::WriteTimeout` error. This commit
changes `send_request_with_body_stream` to remove the optimization that
was making `Net::HTTP#write_timeout` not work when `body_stream` is
used.

Open issue:
https://bugs.ruby-lang.org/issues/17933

a0fab1ab52
2021-07-29 15:53:54 +09:00
Jean Boussier
1229ad0528 [ruby/net-http] Fix the regexp used to clean the host
Introduced in c165203564

`/s` marks the regexp as encoded with Windows-31J which makes little
sense.

Nurse thinks the intent was to use `/m` for a multi-line regexp.

6c15342cdf
2021-04-28 11:01:41 +09:00