636 Commits

Author SHA1 Message Date
HoneyryderChuck
32f2b2b217 Merge branch 'issue-222' into 'master'
Adding HTTPX::Response::Body#filename

See merge request os85/httpx!228
2023-01-02 12:48:49 +00:00
HoneyryderChuck
c7a38ee5b4 bugfix: exit with error when unix socket path does not exist 2022-12-29 12:54:47 +00:00
HoneyryderChuck
db939b56d2 Adding HTTPX::Response::Body#filename
This returns the filename advertised in the content-disposition header.
It reuses the same logic which existed for parsing multipart responses,
which itself was based on `rack`'s.
2022-12-29 01:09:14 +00:00
HoneyryderChuck
d629402245 linting 2022-12-20 22:28:07 +00:00
HoneyryderChuck
f6acd9ed61 remmoved traces of website building 2022-12-04 01:26:31 +00:00
HoneyryderChuck
17297cf062 use --force-yes for 2.2 2022-11-28 23:19:34 +00:00
HoneyryderChuck
bd66b00882 force unsigned package for ruby 2.1 2022-11-28 22:55:09 +00:00
HoneyryderChuck
92737d09b5 rewriting repo links to point to new namespace 2022-11-28 22:45:44 +00:00
HoneyryderChuck
3d4fe177e3 rubocop changes 2022-11-01 22:41:42 +00:00
HoneyryderChuck
c1281a9074 native resolver: switch from nameserver if dns query fails
a behaviour has been observed behind a vpn, where when one of the
servers is unresponsive, the switch to the next nameserver wasn't
happening. Part of it was a bug in the timeout handling, but the rest
was actually the switch not happening (i.e. it'd fail on the first
server). This fixes it by switching to the next nammeserver on query
error.
2022-09-20 23:11:08 +01:00
HoneyryderChuck
535a30db25 fixing issues around typing 2022-08-13 16:34:02 +01:00
HoneyryderChuck
c70209db4b added xml transcoder
capabilities to encod/decode xml, expects nokogiri.
2022-08-13 15:42:46 +01:00
HoneyryderChuck
eb3d3f9048 implementation of the webdav plugin 2022-08-13 15:30:37 +01:00
HoneyryderChuck
c31ded54e1 circuit breaker plugin 2022-08-07 22:24:57 +01:00
HoneyryderChuck
71cb66e287 added missing options sig 2022-08-07 14:43:29 +01:00
HoneyryderChuck
3f9c165d51 added request_timeout 2022-08-06 23:20:21 +01:00
HoneyryderChuck
c907942c9c unique domains for altsvc cache tests 2022-08-06 22:30:46 +01:00
HoneyryderChuck
452657c805 Added the read_timeout and write_timeout timeouts
These are deadline oriented for the request and response, i.e. a write
timeout tracks the full time it takes to write the request, whereas the
read timeout does the same for receiving the response.

For back-compat, they're infinite by default. v1 may change that, and
will have to provide a safe fallback for endless "stream" requests and
responses.
2022-08-06 22:30:46 +01:00
HoneyryderChuck
ee49d7452c added tests for read and write timeout 2022-08-06 22:30:46 +01:00
HoneyryderChuck
43016795f3 introducing the :no_proxy option
can be passed in the `:proxy` option hash, and receives domains, as
strings, which requests should not go through the proxy.
2022-08-05 22:37:52 +01:00
HoneyryderChuck
39beff84ab added ability to check if request has been proxied 2022-08-04 14:02:44 +01:00
HoneyryderChuck
7c1ed56714 fixing local proxy list 2022-08-04 14:01:47 +01:00
HoneyryderChuck
f48f4e414a Fixes and improvements on the response_cache plugin
The following improvements were done:

* only cacheable status codes are allowed now (200, 203, 300, 301, 410)
* only responses considered fresh are cached; fresh response means:
  * no-store directive not present in cache-control
  * response hasn’t expired (when s-maxage, max-age or expires are
      present)
2022-08-01 17:40:05 +01:00
HoneyryderChuck
32a81f2025 fix: response cache now also takes verb into account when caching
The previous strategy was working only with URLs. This strategy would
fall flat if the same url could be used with several HTTP verbs.
2022-07-31 17:03:30 +01:00
HoneyryderChuck
4a0bfa3544 Merge branch 'issue-174' into 'master'
altsvc improvements

Closes #174

See merge request honeyryderchuck/httpx!207
2022-05-25 22:28:18 +00:00
HoneyryderChuck
38152e8dee fix vary header handling to deal with capitalized, test the path
directly in store
2022-05-25 23:15:30 +01:00
HoneyryderChuck
e740a38bad follow_redirects: halt redirection if no location header is present in response 2022-05-25 18:58:11 +01:00
HoneyryderChuck
b6819de30c ennabling cache test again 2022-05-23 23:56:43 +01:00
HoneyryderChuck
56cdc2c75c test the altsvc cache clear path 2022-05-23 23:51:49 +01:00
HoneyryderChuck
889c2f3f79 Merge branch 'issue-189' into 'master'
Support other auth schemes for proxies (digest, ntlm...)

Closes #189

See merge request honeyryderchuck/httpx!204
2022-05-16 22:15:29 +00:00
HoneyryderChuck
71bb6dc2ce Merge branch 'issue-179' into 'master'
Disable SNI when the URL host is an IP

Closes #179

See merge request honeyryderchuck/httpx!203
2022-05-16 22:15:21 +00:00
HoneyryderChuck
0d01f728aa introducing base_path option
This should complement the `:origin` option, in order to provide good
defaults to build REST SDKs around of.

Ex:

```ruby
HTTPX.with(origin: "https://api.this-product.com", base_path: "/v3.1")
```
2022-05-08 17:43:26 +01:00
HoneyryderChuck
c86f4be1a7 reworking auth APIs for a future 1.0 refactoring 2022-05-08 17:23:07 +01:00
HoneyryderChuck
a316b31e7d fix: SNI is now disabled when the URL host is an IP 2022-05-07 18:17:47 +01:00
HoneyryderChuck
6dcf9f0d75 enabling and adding a test for using proxy digest auth 2022-05-07 16:49:00 +01:00
HoneyryderChuck
817a10a537 scoping http auth schemes out of its plugins, made them usable in proxy
In order to expose other auth schemes in proxy, the basic, digest and
ntlm modules were extracted from the plugins, these being left with the
request management. So now, an extra parameter, `:scheme`, can be
passed (it'll be "basic" for http and "socks5" for socks5 by default,
can also be "digest" or "ntlm", haven't tested those yet).
2022-05-07 13:57:10 +01:00
HoneyryderChuck
e3191f0d6c rubocop lint 2022-05-06 17:58:13 +01:00
HoneyryderChuck
637d2f7600 fix: proxy credentials were not being used
a regression from the 0.19.x series was omitting the proxy credentials
when passed directly as proxy options (instead of being part of the URI).

Closes #188
2022-04-05 22:53:45 +01:00
HoneyryderChuck
5307b33cb6 more timmeout leeway, using Thread.kill instead (truffleruby tests) 2022-03-29 22:55:01 +01:00
HoneyryderChuck
82a3657153 disabling pattern matching tests for truffleruby 2022-03-21 23:43:38 +00:00
HoneyryderChuck
30df921387 limit candidates resolution to the first resolv call, while also adapting the retries logic in the native resolver 2022-03-20 15:44:12 +00:00
HoneyryderChuck
35d9c15f44 bumped version to 0.19.4 2022-03-06 17:22:17 +00:00
HoneyryderChuck
552d0d859c fix truffleruby build 2022-03-06 16:33:35 +00:00
HoneyryderChuck
e9a81d6b16 enabled h2 tests which were blocked for jruby 2022-03-05 17:33:37 +00:00
HoneyryderChuck
8eee10be21 regenerated test certs, keeping ca.crt around this time 2022-03-04 23:43:05 +00:00
HoneyryderChuck
a4a60290ac jruby: add test root certificate via keytool 2022-03-04 23:43:05 +00:00
HoneyryderChuck
1fd9cbc83e tests: disable auto-compaction for mimemagic-related tests
mimemagic seems to corrupt memory under auto-compaction, so disabling it
until it's fixed.

https://github.com/mimemagicrb/mimemagic/issues/166
2022-02-13 15:02:54 +00:00
HoneyryderChuck
fc977a7c83 adding git, because bundler still requires it even if alt-ruby should not download dep 2022-02-01 23:03:59 +00:00
HoneyryderChuck
81d399a324 updated test certs (expired) 2022-02-01 22:54:59 +00:00
HoneyryderChuck
b5b0e89dd1 on Response.response=, check if it's an error before expecting to use Response API; this triggers a second exception which won't be propagated and causes a loop 2022-02-01 22:48:42 +00:00