52 Commits

Author SHA1 Message Date
HoneyryderChuck
25b949cf66 Added support for multiple JSON parsers
When available, httpx will either use `multi_json`, `oj`, or `yajl`,
before it falls back to default `json`.
2022-08-05 22:57:06 +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
61c36c4ef9 response cache: caching several instances for the same URL
by relying on vary header, this should have the effect of not
overflowinng, and doing what the user wants.
2022-08-01 18:40:21 +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
c86f4be1a7 reworking auth APIs for a future 1.0 refactoring 2022-05-08 17:23:07 +01:00
HoneyryderChuck
be06032649 adding APIs for running other proxy auth schemes, and adapting internals to work with it 2022-05-07 18:20:07 +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
a3ee98f410 implementation of the response cache plugin 2021-10-01 23:53:21 +01:00
HoneyryderChuck
bdcd4b31b5 aws_sdk plugin: removing S3 plugin APIs, replacing it with barebones aws-sdk-core components 2021-10-01 23:20:19 +01:00
HoneyryderChuck
6e6c7848cc making jitter a retry plugin option 2021-09-20 12:37:48 +01:00
HoneyryderChuck
cdcbf14675 few sig changes (more assertive) 2021-08-31 13:50:29 +01:00
HoneyryderChuck
8ded86cec6 improving sigs for new components 2021-08-10 11:10:45 +01:00
HoneyryderChuck
6b61b8ccdb fixing signatures
also adding some checks on code, in order for steep to stop complaining
about potential nil returns.
2021-08-10 10:28:58 +01:00
HoneyryderChuck
37f23ad8c3 cookie: force name to string; as for the value, only late-force it on writing the cookie 2021-07-16 09:52:21 +01:00
HoneyryderChuck
174f5f9647 allow cookie jar to merge 2021-07-15 15:53:15 +01:00
HoneyryderChuck
fbe8a16b1c small sig fixes 2021-07-13 20:04:38 +01:00
HoneyryderChuck
cab5a94d31 removing setters from Options, which weren't public API anyway 2021-07-13 19:56:59 +01:00
HoneyryderChuck
5604501d01 using the new OptionsMethods way for defining internal plugin options 2021-07-13 19:56:59 +01:00
HoneyryderChuck
b6ee019014 several signature improvements while testing with steep 2021-07-07 19:21:36 +01:00
HoneyryderChuck
5cfb494d50 allow parsers to define a connection timeout, and channge it via callback 2021-05-30 00:57:54 +01:00
HoneyryderChuck
fb3b795f29 adding missing grpc sigs (+ other missing stuff in plugin calls) 2021-05-28 12:15:09 +01:00
HoneyryderChuck
5b9793752c fixing other plugin signatures 2021-05-27 19:11:15 +01:00
HoneyryderChuck
df489676ac adding ntlm auth plugin 2021-05-27 19:11:15 +01:00
HoneyryderChuck
dda1315db4 adding tests to enure that field order is respected, even when repeated, when performing form/multipart requests (Closes #126) 2021-05-27 19:11:15 +01:00
HoneyryderChuck
c61007ba0f do not forget the filename in those multipart spoofs 2021-05-27 17:53:45 +01:00
HoneyryderChuck
441716a5ac fixing double-response for streams
there was a long-standing buggy workaround, whereas in stream-mode, when
there was no response yet to query from, a synchronous request would be
fired. This would break when under event streams, so we had to document
this as "make sure that...".

This fixes it by implementing a general session API convention, which
separates the step of sending the requests, from waiting for its
receival. And, given that the request knows when the response is
available, we can actually "tick until response".

This might be used in the future to refactor the way we handle the
responses, which buffer the full payload by default, instead of reading
from the connection at will.
2021-05-20 00:11:26 +01:00
HoneyryderChuck
837c7ddf17 allowing .deflate to be called synchronously 2021-05-06 10:38:20 +01:00
HoneyryderChuck
3e7dfe3e7f stream: moved StreamResponse to the HTTPX namespace 2021-05-04 20:09:50 +01:00
HoneyryderChuck
e436c4fa04 options: always load plugins in the .configure callback 2021-05-04 20:09:50 +01:00
HoneyryderChuck
9363d09af8 removed with_ methods from option (not of real world use)
removed with_ options, which are unsupported, undocumented and irrelevant (contrary to the similar with session methods)
2021-03-23 16:30:45 +00:00
HoneyryderChuck
e8ac876443 setting the upgrade handlers per session. 2021-03-07 16:18:44 +00:00
HoneyryderChuck
d501840669 registering the supported encodings of the compression plugin per
session

In order not to leak these into other sessions, one keeps a registry
around as a session option. This will cascade into the request and
response encoding routines.
2021-03-05 19:04:09 +00:00
HoneyryderChuck
72a397b841 added (and fixing bug for) test of subsequent request on upgraded
connection

After the connection has been upgraded and session is kept open,
subsequent requests were still trying to upgrade it. This fixes it by
marking the connection as upgraded, and falling back to normal
behaviour when it is.
2021-03-05 12:23:07 +00:00
HoneyryderChuck
a77091f9e7 refactor the h2c plugin on top of the upgrade plugin
By setting the h2c protocol handler, the rest became much simpler.

Formatting the upgrade request is a matter for the sub-plugin.
Therefore, the specific h2c request upgrade headers are built-in there.
2021-02-28 03:06:03 +00:00
HoneyryderChuck
48961d6c64 do not select on an http/2 connection with no ongoing comms
It was observed that, during a request done via a DoH resolve, the
resolver connection is left in the selector, despite already having
resolved the name, until the whole transfer is done. This is
inefficient, as we're not expected to use it again.

Fixed by improvinng the interest calculation of an HTTP/2 connection; if
the connection doesn't have anything to write. and there aren't  any
inflight streams nor pings, connection won't be listened on.
2021-02-21 16:09:45 +00:00
HoneyryderChuck
ff87177a4a added module signatures 2021-02-06 16:24:35 +00:00
HoneyryderChuck
7fa283097d added signatures to new modules 2021-01-13 12:27:13 +00:00
HoneyryderChuck
65f5e86f3f allowing nested params also when posting multipart requests 2020-12-10 13:46:57 +00:00
HoneyryderChuck
beb0a82baa typing selector and connection 2020-12-07 16:30:39 +00:00
HoneyryderChuck
a675fde7dd enable singleton usage in rbs sigs 2020-12-02 01:30:38 +00:00
HoneyryderChuck
201591e9fe added test for the socks5 non-happy path 2020-12-02 01:30:38 +00:00
HoneyryderChuck
7a5353ea90 fixed signing of the stream session request 2020-11-25 11:54:51 +00:00
HoneyryderChuck
1e21c33da0 fixinng the signatures for the last rbs upstream 2020-11-24 00:42:54 +00:00
HoneyryderChuck
cbfb5c968e moving domain_name module to core httpx, as the punycode IDN translation will be needed at this layer 2020-11-07 01:34:48 +00:00
HoneyryderChuck
5f735cc6f5 Merge branch 'issue-50' into 'master'
rate limiter plugin

See merge request honeyryderchuck/httpx!99
2020-11-06 17:25:06 +00:00
HoneyryderChuck
267f320fe0 updated signatures to use latest interface additions in rbs 2020-11-04 01:21:28 +00:00
HoneyryderChuck
048501e940 adding and integrating the new cookie modules for: store, jar, cookie, and domain name 2020-11-04 00:32:01 +00:00
HoneyryderChuck
959429b386 improved cookies testing, to test also the array-of-cookie-hashes case; does not accept a string anymore, as besides untested, it wasn't working properly 2020-11-03 16:33:11 +00:00
HoneyryderChuck
1ad2e9cbcf implemented the rate limiter plugin 2020-10-31 14:15:28 +00:00
HoneyryderChuck
e02e8029ad made encoder API more consistent across request body encoders 2020-10-30 16:19:18 +00:00