1257 Commits

Author SHA1 Message Date
HoneyryderChuck
e2b4cc0938 updating test TLS certs 2021-01-30 15:31:03 +00:00
HoneyryderChuck
129bcf1871 fixing decompression issue when last DATA frame is empty
An error arose in decompressing a GZIP body from an HTTP/2 response,
where the second-to-last DATA frame actually sent the last meaningful
data chunk, and the server emitted an additional empty frame with
`end_stream` flag.

This error was introduced in the transition to ruby 3 and RBS
refactorings, when the gzip inflater closes automatically once all the
advertised (in "content-length" header) bytes are successfully
decompressed. In the case described above, the empty chunk still dives
into the decompressor and passed to the now closed ZLib::Stream, which
triggeres an exception.

The fix is to halt decompression early in the chain. Response#write
already knows how to deal with empty frames, so the control should be
passed there.

Fixes #112
2021-01-29 18:09:11 +00:00
HoneyryderChuck
1368ed2df7 Merge branch 'fix-formdata' into 'master'
Fix formdata

See merge request honeyryderchuck/httpx!115
v0.11.0
2021-01-14 16:15:43 +00:00
HoneyryderChuck
af8539a7a7 multipart form: skip parts where value is nil 2021-01-14 16:07:11 +00:00
HoneyryderChuck
b8745bb3cc fixed concatenation of formdata parts, which wasn't filling HTTP/2 frames, and was causing miscalculations for buffers 2021-01-14 16:07:11 +00:00
HoneyryderChuck
890111c2f8 quote fields in formdata params for multipart 2021-01-14 16:07:11 +00:00
HoneyryderChuck
644783c642 keep loading http/form_data, mark for deprecation 2021-01-14 16:07:11 +00:00
HoneyryderChuck
654b791314 bumped to 0.11.0 2021-01-14 11:05:06 +00:00
HoneyryderChuck
bebd2bd11e don't account for #build_requests misusages (private API, we control it) 2021-01-14 00:50:23 +00:00
HoneyryderChuck
b2dff40839 reraise IOError on yield of io, when the error doesn't involve the
client io specifically.

This was the case for multipart tests raising IOErrors on upload files
instead of IO, which was causing the loop to break.
2021-01-14 00:37:00 +00:00
HoneyryderChuck
6e0df603db removed disabling of coverage and needless conditionals 2021-01-14 00:36:44 +00:00
HoneyryderChuck
ed8fcd7892 test covering untested paths of Session#build_requests 2021-01-14 00:35:52 +00:00
HoneyryderChuck
cbfdfed6c4 socks5 test covering failed authenticationn path 2021-01-14 00:35:22 +00:00
HoneyryderChuck
c5512dbbeb enable push frames in no push test in order to force refusal 2021-01-14 00:34:51 +00:00
HoneyryderChuck
a38724d134 renamed cop for ruby 2.3 2021-01-13 17:05:24 +00:00
HoneyryderChuck
0ffea8d6e4 Merge branch 'issue-99' into 'master'
Remove http-form_data, own multipart handler

Closes #99

See merge request honeyryderchuck/httpx!113
2021-01-13 17:00:04 +00:00
HoneyryderChuck
a29961962b allowing multipart requests to be retried (although, to be fair, user has to push a lot of knobs to do so) 2021-01-13 13:40:05 +00:00
HoneyryderChuck
fd91aca873 closing descriptors as they're flushed by the request.
this wasn't as easy due to reliance on Request#bytesize, which was
calling File#size on the closed file descriptors, which raised an
IOError caught by the selector. Caching fixes it, and removes the
recalculations from the hot path as well.
2021-01-13 13:40:05 +00:00
HoneyryderChuck
4987b2d583 disabling old cops 2021-01-13 12:27:13 +00:00
HoneyryderChuck
1691f50af5 fixing usage of Enumerable#sum for older rubies 2021-01-13 12:27:13 +00:00
HoneyryderChuck
7fa283097d added signatures to new modules 2021-01-13 12:27:13 +00:00
HoneyryderChuck
80f0ddfbc8 adding file tool to the CI 2021-01-13 12:27:13 +00:00
HoneyryderChuck
d39c82cea8 do not close parts (http2 handler failing to write when nit does) 2021-01-13 12:27:13 +00:00
HoneyryderChuck
42297cd38d simplifying apis, testing pathnames 2021-01-13 12:27:13 +00:00
HoneyryderChuck
478558d4bf making sure we don't leave file descriptors behind 2021-01-13 00:00:09 +00:00
HoneyryderChuck
d2ee0cdb78 extracting mime type in different strategies (inherited from shrine's determine mime type plugin) 2021-01-13 00:00:09 +00:00
HoneyryderChuck
a9cf1abdcd adding multipart components 2021-01-13 00:00:09 +00:00
HoneyryderChuck
25d5e93248 added additional tests for the future accepted variationns of multipart parameters 2021-01-13 00:00:09 +00:00
HoneyryderChuck
41a0b8ff34 move http-form_data to test dependencies block 2021-01-13 00:00:09 +00:00
HoneyryderChuck
73384aa211 Merge branch 'issue-109' into 'master'
Expect: fixes and improvemennts

Closes #109

See merge request honeyryderchuck/httpx!114
2021-01-12 23:59:21 +00:00
HoneyryderChuck
e1ccae25f9 added a global store for domains not supporting 100-continue
it's a pretty naive implementation, as it grows unbounded, and isn't
thread safe, mostly due to negligent cost of fake fetch.
2021-01-12 23:53:18 +00:00
HoneyryderChuck
49aa918fa2 testing locally with docker revealed an issue when using the system resolver, which waits indefinitely when no timeout is setup; usinng the 5 seconds everywhere, as the native resolver was already using it 2021-01-12 17:44:22 +00:00
HoneyryderChuck
68baf484da reshaping the way 100 responses are handled, by keeping informational status (right now working only for 100, as 101 breaks h2c) 2021-01-12 17:43:14 +00:00
HoneyryderChuck
32eebe6d9d revert deactivation of expect when receiving an 100 response 2021-01-12 12:43:31 +00:00
HoneyryderChuck
2f210d81e1 Merge branch 'fix-pool-based-tests' into 'master'
Fix pool based tests

See merge request honeyryderchuck/httpx!112
2021-01-11 18:17:35 +00:00
HoneyryderChuck
c2a85311d4 fixed signature of expects\? 2021-01-09 17:28:02 +00:00
HoneyryderChuck
75089a334a added test for Socks5 connection establishment using an IP.
The test only tests IPv4 due to lack of support for IPv6 in the current
docker test suite, but IPv6 is expected to work as well.
2021-01-09 17:14:36 +00:00
HoneyryderChuck
dd28a39eef allow passing custom hostname to tls options for SNI
this effectively allows one to perform TLS negotiation with a
reverse-proxy while passing a different host. This host can also be
passed directly in the "host" header while the uri can contain the IP
2021-01-09 17:12:30 +00:00
HoneyryderChuck
0c646ced85 fixed expect 100 plugin delay feature
another bug gets fixed after adding a test... the delay of sending the
request body when server doesn't support the Expect-100 continue dance
wasn't using the proper API. Adapted the handling of the state machine
to be more readable and compliant as well.
2021-01-09 16:20:01 +00:00
HoneyryderChuck
256ec59bdd added resolver alias test 2021-01-09 01:58:03 +00:00
HoneyryderChuck
1985ed7299 Merge branch 'blog' into 'master'
Blog

See merge request honeyryderchuck/httpx!111
2021-01-09 00:33:56 +00:00
HoneyryderChuck
40180066a9 also deploy pages from blog branch 2021-01-09 00:28:03 +00:00
HoneyryderChuck
88ecb96511 added note to last post 2021-01-09 00:25:25 +00:00
HoneyryderChuck
14db276c14 CI: do not run tests in blog branch 2021-01-09 00:22:24 +00:00
HoneyryderChuck
fab44b5993 verifyig error responses annd deltas using internal methods 2021-01-05 18:57:39 +00:00
HoneyryderChuck
a6176ec01f using session pool for coalescing test, thereby minimizing interference (although it would have been nice to have more entropy) 2021-01-05 10:38:28 +00:00
HoneyryderChuck
cdf6868059 moar logging 2021-01-04 19:12:25 +00:00
HoneyryderChuck
a1b27f5349 make origins comparison less flakey 2021-01-04 19:08:01 +00:00
HoneyryderChuck
2853cde6db mapping origins correctly now 2021-01-04 19:01:03 +00:00
HoneyryderChuck
8a570f7d4c fixing location of origins var 2021-01-04 18:53:54 +00:00