Martin Algesten
f36c140315
Add gzip and brotli to CI test matrix
2022-11-26 11:46:00 +01:00
Martin Algesten
8e8b1abd53
Upgrade deps
2022-11-26 11:46:00 +01:00
Martin Algesten
5d9e89917c
Test case showing gzip chunk not pooling
2022-11-26 01:44:08 -08:00
Martin Algesten
b0796c18f3
Make build work ( #546 )
...
The mbedtls example has caused problem in the main build a number of
times. By making it a standalone `cargo new --bin`, we can keep it in
the source tree as a good example but avoid having it break the main
build.
Also, fix some clippy lints.
2022-09-29 08:29:32 -07:00
Martin Algesten
134d82ecf4
debug! log method of body response
2022-07-10 11:55:57 +02:00
Martin Algesten
0a202ad90f
Updated CHANGELOG for 2.5.0
2022-07-10 11:30:40 +02:00
Martin Algesten
84d58587c0
Bump version to 2.5.0
2022-07-10 11:30:40 +02:00
Martin Algesten
9395046029
IoResult -> io::Result ( #521 )
2022-06-11 17:06:43 -07:00
Martin Algesten
4675d748e9
Remove Sync bound from TlsConnector io arg
2022-05-07 14:39:59 +02:00
Martin Algesten
049b5a5acd
Fixes after feedback
2022-05-07 14:39:59 +02:00
Martin Algesten
65371c966c
Box<dyn ReadWrite> for TlsConnector::connect
2022-05-07 14:39:59 +02:00
Martin Algesten
653cf03dee
Fix and and
...
Close #503
2022-04-24 19:40:20 +02:00
Martin Algesten
ce13168a96
Run cargo readme
2022-04-22 20:41:40 +02:00
Martin Algesten
21238ef2e0
Provide example of more in-depth TLS config
...
Close #480
2022-04-12 20:43:27 +02:00
Martin Algesten
e225532966
Update cookie dep to 0.16
2022-04-12 20:33:09 +02:00
Martin Algesten
4f3ea15523
Clean up mbedtls example
2022-01-31 09:45:57 +01:00
Martin Algesten
5dbaa9a256
Rename example mbedtls-req -> mbedtls
2022-01-31 09:45:57 +01:00
Martin Algesten
2c29cc230c
Remove Sync requirement of ReadWrite trait
...
3rd party TLS connections are currently required to provide a Sync
guarantee. Since ureq will only ever use the connection on a single
thread, this is not necessary.
The reason we end up with this bound is because we want Response and
Error to be Sync, in which case Rust's automatic inferral of Sync
fails.
This change "masks" the Stream in a wrapper making it Sync.
Close #474
2022-01-30 21:50:11 +01:00
Martin Algesten
219b5edf9e
Rename test function as_write_vec -> into_written_bytes
...
Tests use `Response::as_write_vec` to inspect the outgoing HTTP/1.1
request line and headers. The current version has two problems:
1. Called `as_write_vec` when it actually returns a `&[u8]`.
2. Inspects/uses the `Response::stream` without consuming `Response`.
The first problem is trivial, but the second is subtle. Currently all
calls on `Response` that works with the internal `Response::stream`
consumes `self` (`into_string`, `into_reader`).
`Response` is by itself `Send + Sync`, and must be so because the
nested Stream is `Read + Write + Send + Sync`. However for
implementors of `TLSStream`, it would be nice to relax the `Sync`
requirement.
Assumption: If all fields in Response are `Sync` except
`Response::stream`, but any access to `stream` consumes `Response`, we
can consider the entire `Response` `Sync`.
This assumption can help us relax the `TlsStream` `Sync` requirement
in a later PR.
2022-01-29 17:32:18 +01:00
Martin Algesten
6e5041044b
Rename trait HttpsStream -> ReadWrite and make it public
...
Also provide an example of how to use it.
2022-01-22 10:41:22 +01:00
Martin Algesten
007ce44ea7
Bump version to 2.4.0
2021-12-23 08:38:00 +01:00
Martin Algesten
adbd9144af
Update changelog for 2.4.0
2021-12-23 08:38:00 +01:00
Martin Algesten
3b68dce23a
Make Middleware always Send + Sync + 'static
2021-12-22 07:58:45 +01:00
Martin Algesten
81c0e66ec7
MiddlewareNext iterator without Box
...
Thanks @jsha for showing me the way.
2021-12-22 07:58:45 +01:00
Martin Algesten
43680335dc
Middleware chain based on iterator
2021-12-22 07:58:45 +01:00
Martin Algesten
a2d62368f3
Remove Option wrapper around middleware
2021-12-22 07:58:45 +01:00
Martin Algesten
09ecb6ffd6
Implement middleware function
2021-12-22 07:58:45 +01:00
Martin Algesten
7b2f28bbc2
Tidy up Response::url initialization
2021-12-22 07:58:45 +01:00
Martin Algesten
87cf59d399
Doc fix
2021-12-22 07:58:45 +01:00
Martin Algesten
98ac6313e5
Agent/AgentBuilder impl Debug manually
2021-12-22 07:58:45 +01:00
Martin Algesten
738cb84aec
Enable 'gzip' by default
2021-12-20 02:38:18 +01:00
Martin Algesten
4aa5480543
Improve doc after review
2021-12-19 21:17:26 +01:00
Martin Algesten
8f476e9d29
cargo fmt
2021-12-19 21:17:26 +01:00
Martin Algesten
75f6be8ff8
Format error message like suggested in review
2021-12-19 21:17:26 +01:00
Martin Algesten and Jacob Hoffman-Andrews
d1a2c630f5
Update src/rtls.rs
...
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com >
2021-12-19 21:17:26 +01:00
Martin Algesten and Jacob Hoffman-Andrews
324c5c074f
Update src/error.rs
...
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com >
2021-12-19 21:17:26 +01:00
Martin Algesten
f3857eed00
Ensure we provide a Transport::message() when we can
2021-12-19 21:17:26 +01:00
Martin Algesten
6a094db668
Provide access methods for error::Transport
...
.message() and .kind() so that the user can get the details of a transport
error. This also documents the motivation for the different fields
2021-12-19 21:17:26 +01:00
Martin Algesten
158a6c6f03
Clarify serde doc on Response::into_json ( #451 )
...
Close #428
2021-12-19 11:41:44 -08:00
Martin Algesten
0f0dec5f32
Fixes after feedback
2021-12-19 11:00:39 +01:00
Martin Algesten
2b0eca9827
Move auth header on redirect to unit construction
...
The auth header stripping was in the wrong place (when serializing the request),
rather than in the construction of the Unit, where it ought to be.
This also makes redirect header retention testable.
2021-12-19 11:00:39 +01:00
Martin Algesten
f941717a5d
Mark RedirectAuthHeaders as non_exhaustive
2021-12-19 11:00:39 +01:00
Martin Algesten
27533cf31b
Use match expression against RedirectAuthHeaders to ensure exhaustive
2021-12-19 11:00:39 +01:00
Martin Algesten
c59632bd97
Use Url (instead of String) in internal history var
2021-12-19 11:00:39 +01:00
Martin Algesten
2a5ab43c8c
Expose RedirectAuthHeaders enum at crate root
2021-12-19 11:00:39 +01:00
Martin Algesten
8d33318a23
Rename setter to be consistent with other builder settter
2021-12-19 11:00:39 +01:00
Martin Algesten
b033e0f614
Doc fixes to RedirectAuthHeaders
2021-12-19 11:00:39 +01:00
Martin Algesten
876d5757a7
Update changelog
2021-11-28 22:45:16 +01:00
Martin Algesten
3709221a28
Handle 400-error from client.badssl.com
2021-11-28 22:45:16 +01:00
Martin Algesten
a6d1750f14
Fix native-certs and add to test matrix
...
Close #239
2021-11-28 22:45:16 +01:00
Martin Algesten
a1d7009e24
2.2.0
2021-08-23 21:32:42 +02:00
Martin Algesten
551f4289fb
Update all dependencies
...
webpki and webpki roots are not compatible with current rustls,
so they are held back.:wq
2021-08-23 21:21:39 +02:00
Martin Algesten
4ed42088b7
Add -m and -ct to cureq example
2021-08-23 21:11:27 +02:00
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
Martin Algesten
526eb7b9e0
Fix clippy lints
2021-08-23 20:45:33 +02:00
Martin Algesten
989995d1ba
Fix clippy lints ( #387 )
2021-05-11 18:05:17 -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
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
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
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
Martin Algesten and Jacob Hoffman-Andrews
7222931b24
Update src/response.rs
...
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com >
2021-02-21 23:20:58 +01:00
Martin Algesten
ea83edc609
Allow status lines with missing reason phrase
...
The spec says the reason phrase at least must be a space. However in
the wild, there are sites that just ends after the status code.
To be more compatible, this commit relaxes ureq's parsing.
Close #316
2021-02-21 23:20:58 +01:00
Martin Algesten and Jacob Hoffman-Andrews
dc0069670d
Update src/response.rs
...
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com >
2021-02-21 23:20:20 +01:00
Martin Algesten
281a8462b5
Clarify doc
...
Close #326
2021-02-21 23:20:20 +01:00
Martin Algesten
c833acfe5c
2.0.2
2021-02-21 09:30:57 +01:00
Martin Algesten
d76c0e7910
Update changelog for 2.0.2
2021-02-21 09:28:50 +01:00
Martin Algesten
d627ef9704
OrAnyStatus::or_any_status ergonomic helper
...
Some users might prefer to handle all HTTP responses as Response
regardless of status code.
2021-01-30 09:40:45 +01:00
Martin Algesten
06abdff4bf
cargo fmt ( #303 )
2021-01-17 11:07:52 -08:00
Martin Algesten
948f736125
Document proxy support ( #298 )
...
ureq supports proxying using HTTP CONNECT and SOCKS5, the features are however
missing documentation. This brings it to the lib.rs doc.
2021-01-09 09:58:07 -08:00
Martin Algesten
c24b250c80
Implement std::error::Error for error::Transport ( #299 )
...
Close #294
2021-01-09 09:56:20 -08:00
Martin Algesten
6da035b669
Update CHANGELOG.md
...
Change 2.0.0-rc2 => 2.0.0
2021-01-03 21:22:40 +01:00
Martin Algesten
8f9f3e5827
Fix main lib.rs and README.md example ( #284 )
...
Small fixes to just ensure lib.rs and README.md are run via cargo readme.
2021-01-03 10:38:10 -08:00
Martin Algesten
1f0d84279a
Document simplest error example
2020-12-27 23:47:43 +01:00
Martin Algesten
5aff777f1f
Refactor Display for Transport
2020-12-05 20:00:47 +01:00
Martin Algesten
b91d196fbc
error::Transport part of public API
2020-12-05 20:00:47 +01:00
Martin Algesten
f652a9e449
rename error_for_status -> error_on_non_2xx
2020-11-15 21:13:45 +01:00
Martin Algesten
d4af920b53
Fix body send doc tests
2020-11-15 21:10:19 +01:00
Martin Algesten
b66e618198
Gate entire mod cookies on "cookies" feature
2020-11-08 11:31:49 +01:00
Martin Algesten
d0789ae8e9
Rename AgentBuilder set_tls_config -> tls_config
...
For consistency. We don't use set_xxx on the builder.
2020-11-08 11:31:49 +01:00
Martin Algesten
a8ee8ab75e
Provide AgentBuilder::cookie_store setter
2020-11-08 11:31:49 +01:00
Martin Algesten
c2bbd57acc
Agent::cookie_store to persist cookies
2020-11-08 11:31:49 +01:00
Martin Algesten
18201a08c5
Remove Agent::set_cookie
...
Preloading an agent with cookies can be done by providing a prepared
cookie store using `AgentBuilder`. At this point, we don't want direct
state mutation on the `Agent`, so this fn goes away.
Context:
https://github.com/algesten/ureq/issues/203#issuecomment-716385310
2020-11-08 11:31:49 +01:00