Commit Graph

564 Commits

Author SHA1 Message Date
Martin Algesten
485647d5de Fix proxy urls that end with trailing slash
Close #402
2021-08-23 20:57:29 +02:00
Martin Algesten
641eb3df10 Fix overlapping redirect tests
Two tests were using /redirect_post1, which breaks if they are running in parallel.
2021-08-23 20:52:08 +02:00
Keijia
2869a80130 oh, use None != proto instead of proto.is_some() 2021-08-23 20:46:44 +02:00
Keijia
c7292919e5 fix build fails 2021-08-23 20:46:44 +02:00
Keijia
f6f021cdbb highlight that socks:// prefix is equal to socks5:// 2021-08-23 20:46:44 +02:00
Keijia
35c472507b whoops, fix tests for socks4://and socks4a:// 2021-08-23 20:46:44 +02:00
Keijia
401d051bd1 add socks4a:// and socks:// tests 2021-08-23 20:46:44 +02:00
Keijia
12b49e59f4 whoops, fix HTTPConnect proxies 2021-08-23 20:46:44 +02:00
Keijia
37e19b34ec add socks4 to readme 2021-08-23 20:46:44 +02:00
Keijia
bdaa9fc68c add support for socks4 and socks4a 2021-08-23 20:46:44 +02:00
Keijia
e198a5169b bump socks to 0.3.3 2021-08-23 20:46:44 +02:00
Martin Algesten
526eb7b9e0 Fix clippy lints 2021-08-23 20:45:33 +02:00
Jelle Besseling
6797258e9d Use debug logs when making requests 2021-08-14 14:36:25 +02:00
Niketh Murali
4665b0aa5a Fix clippy warnings
Fix linter warning from clippy about unnecessary borrows - "This expression borrows a reference ... that is immediately dereferenced by the compiler"
2021-08-13 09:26:04 +02:00
Tshepang Lekhonkhobe
eb04d96af8 Fix a typo (#397) 2021-07-09 09:10:22 -07:00
Gus Power
37e1e91e22 Clear Content-Length header from redirected requests (#394)
This PR removes the Content-Length header from subsequent redirect requests if set.
A test verifies the new behaviour.
2021-06-18 16:12:31 -07:00
Martin Algesten
989995d1ba Fix clippy lints (#387) 2021-05-11 18:05:17 -07:00
Berrysoft
c06c345f28 Remove extra clone when request with Url 2021-05-11 20:18:34 +02:00
dependabot-preview[bot]
39d44af669 Upgrade to GitHub-native Dependabot 2021-04-30 21:53:37 +02:00
12932
db5203d1a0 fix typo "memroy" to "memory" (#379) 2021-04-26 11:41:26 -07:00
Jacob Hoffman-Andrews
c0d7157ae7 Update CHANGELOG and Cargo.toml for 2.1.1 (#376) 2021-04-26 11:00:53 -07:00
Jacob Hoffman-Andrews
50d9ccff8c Don't reuse conns with bytes pending from server (#372)
This makes us less likely to try and reuse a closed connection, which
produces problems in particular for requests that can't be retried.

Fixes #361
Fixes #124
2021-04-18 10:46:20 -07:00
Jacob Hoffman-Andrews
5e4b37a393 Add more parameters to cureq example (#371) 2021-04-17 12:04:44 -07:00
Martin Algesten
4ade506047 Allow upper_case_acronyms 2021-04-17 12:30:39 +02:00
Martin Algesten
a6085d8237 Install/use rust toolchain for Lint step 2021-04-17 12:16:56 +02:00
Malloc Voidstar
2f1f9c45aa Fix typo, disable default features of cookie 2021-04-10 16:28:54 +02:00
Martin Algesten
e70fdcc797 2.1.0 2021-03-26 07:45:11 +01:00
Martin Algesten
1199432cfe Changelog for 2.1.0 2021-03-26 07:45:11 +01:00
Martin Algesten
3cfa9e6b35 Refactor into_string body reading 2021-03-25 21:49:39 +01:00
Martin Algesten
7c6ed53df3 Move Response::unit and stream to the heap 2021-03-25 21:04:12 +01:00
Martin Algesten
cfaca317c6 Provide url in Response Debug impl 2021-03-25 07:45:34 +01:00
Jacob Hoffman-Andrews
3044ae7efd Add size limits on responses (#351)
This prevents a malicious server from running the client out of memory
by returning a very large body.

Limit into_string() to 1 megabyte.
Limit individual header fields to 100 kilobytes.
Limit number of header fields to 100.

Part of #267
2021-03-24 13:28:23 -07:00
Martin Algesten
40e156e2a3 Url access functions for Request (simpler) 2021-03-24 20:58:47 +01:00
Martin Algesten
8f16b53c19 Run clippy in CI lint 2021-03-24 20:29:43 +01:00
Martin Algesten
b42e9afd71 Fix clippy warnings 2021-03-24 20:29:43 +01:00
Martin Algesten
ea53c7cedd Use is_tchar for cookie name check 2021-03-24 20:09:27 +01:00
Martin Algesten
5c9b1b9a0c Enforce cookie RFC name/value rules 2021-03-24 20:09:27 +01:00
Martin Algesten
c5c40cf138 Stop percent encoding cookies 2021-03-24 20:09:27 +01:00
Jacob Hoffman-Andrews
9ec4e7192a Add -k option to cureq example (#342)
By analogy with curl, this turns off certificate verification. Requires
enabling the "dangerous_configuration" feature in the rustls dependency.
2021-03-23 17:00:32 -07:00
Jacob Hoffman-Andrews
a34d450657 Remove specialized error message for complete_io. (#349)
This was triggering for errors like InvalidCertificate and giving the
message "Sometimes this means the host doesn't support any of the same
ciphersuites as rustls, or doesn't support TLS 1.2 and above," which is
confusing in that situation.

For now, offer no specialized error. I'd like to come back when I find
more time and restore this, but only for the error cases where it's
useful.
2021-03-23 17:00:09 -07:00
Martin Algesten
026cf75690 Handle non-utf8 status and headers
Non-utf8 headers are ignored and reading the value for them will
yield `None`.
2021-03-14 23:14:43 +01:00
Martin Algesten
9a9dd4ee6c Upgrade cookie to 0.15 and cookie_store to 0.13.0
cookie_store default features pulls in reqwest, so we stop that
by specifying the exact features wanted.
2021-03-14 19:00:28 +01:00
Martin Algesten
0dc609fc30 Ensure Error and Response implement Send+Sync
This is to ensure we don't accidentally introduce breaking changes
with respects to Send and Sync.
2021-03-14 19:00:04 +01:00
Martin Algesten
91cb0ce5fc Move unit tests inside conditionally compiled mod tests { } blocks
Idiomatic rust organizes unit tests into `mod tests { }` blocks
using conditional compilation `[cfg(test)]` to decide whether to
compile the code in that block.

This commit moves "bare" test functions into such blocks, and puts
the block at the bottom of respective file.
2021-03-14 18:56:09 +01:00
Martin Algesten
239ba342a2 Provide .method() and .query_params() 2021-03-14 09:46:40 +01:00
Martin Algesten
c4c1618042 Remove unnecessary cloning in Request::do_call() 2021-03-14 09:46:40 +01:00
Martin Algesten
566295bebb Provide context for errors when reading status line and headers
The HTTP spec allows for non-ascii values both in the status line and
in headers. ureq does not handle that, we can however provide better
context for when it happens.
2021-03-13 23:03:25 +01:00
Martin Algesten
a66abdd285 Provide ipv6 example 2021-03-02 19:50:20 +01:00
Douman
ec69c4282c Introduce Request::timeout to override agent's config 2021-02-27 10:59:54 +01:00
trevyn
1e5307cbca Fix typo: "patform" -> "platform" (#332) 2021-02-22 10:34:46 -08:00