Commit Graph

622 Commits

Author SHA1 Message Date
Daniel Eades
06353fbb1a remove deprecated 'try!' macro 2019-08-16 12:59:55 -07:00
Daniel Eades
e45d77584b repair a dodgy find and replace 2019-08-16 12:59:55 -07:00
Daniel Eades
3ba4b6eadf port all optional features to 2018-edition 2019-08-16 12:59:55 -07:00
Daniel Eades
4773408ae4 switch to 2018 edition module structure 2019-08-16 12:59:55 -07:00
Daniel Eades
1452ca2bd1 remove unnecessary extern crate lines 2019-08-16 12:59:55 -07:00
Daniel Eades
5dc5162765 update and tidy code 2019-08-16 12:59:55 -07:00
Daniel Eades
86d9cbc66e cargo fix --edition 2019-08-16 12:59:55 -07:00
Sean McArthur
fd96385097 fix bare trait object lint in dns module 2019-08-16 11:34:42 -07:00
Vignesh Karuthedath (വിഘ്നേഷ് ശ൪മ കെ)
36f2b78122 Give more useful errors when connection through proxy fails
Before the fix anything other than 200 & 407 would throw an unhelpful
`unsuccessful tunnel` error.
After this change,
- Explicit handling of 403, where the proxy forbids a connection.
- All other responses will be part of the error message.
2019-08-16 10:54:09 -07:00
Sean McArthur
7d04fa1dfa Update to released mime_guess v2.0 2019-08-14 11:36:42 -07:00
Sean McArthur
d29e12db10 v0.9.19 2019-07-19 12:23:04 -07:00
Sean McArthur
afbd9e644d Improve error message when using blocking Client inside a Future 2019-07-19 11:47:35 -07:00
Timothée Ravier
9a9bcac336 Enable derive Clone for Certificate & Cert (#569)
This makes it easier to parse Certificates in advance and pass them as
clones for each client request.

Signed-off-by: Timothée Ravier <timothee.ravier@ssi.gouv.fr>
2019-07-18 09:50:40 -07:00
Sean McArthur
9276e2cce7 Fix unused_mut warning in src/tls 2019-07-09 15:11:57 -07:00
WindSoilder
24809dc23c revert docstring back because ClientBuilder don't use system proxy. (#556) 2019-07-03 19:10:14 -07:00
WindSoilder
577d06c363 Add support for system/environment proxies (#547) 2019-07-01 16:27:58 -07:00
messense
1e7c9fe507 Sync Response::text() & Response::json() call their async version 2019-06-26 11:11:07 -07:00
messense
c5f2bf6c32 Add Response::text() to async Client 2019-06-26 11:11:07 -07:00
Dmitry Pankratov
e16aed5e3c Added support for sending requests with streaming Body (#545) 2019-06-14 10:29:54 -07:00
Sean McArthur
fabfa3eb70 Update docs about cookie store 2019-06-06 11:30:36 -07:00
Patrick Fernie
6e5ee3b975 disable percent encoding of cookie name/value when sending request 2019-06-06 11:05:14 -07:00
Sean McArthur
5096e12fa2 Use executor::enter before blocking a thread in wait 2019-06-05 14:41:53 -07:00
Sean McArthur
a701e93edb fix redundant TLSError import warning 2019-06-05 13:21:41 -07:00
Sean McArthur
964d87ce57 Update trait object syntax to use 'dyn' 2019-06-03 13:15:09 -07:00
nirasan
9f22f46e85 Clarify correct specification of dependency on serde (#525)
Closes #494
2019-05-16 10:46:00 -07:00
Sean McArthur
11d477f49a v0.9.17 2019-05-15 13:22:42 -07:00
prfss
c7da30149a Fix cookie header to not include set-cookie attributes (#522) 2019-05-15 13:12:22 -07:00
Ben Boeckel
1bdc3fa3c8 request: test adding duplicate headers to the request (#519) 2019-05-03 11:48:31 -07:00
Sean McArthur
bf5a268079 v0.9.16 2019-04-30 15:27:12 -07:00
WindSoilder
e0a52dcf5d Include new cookie header after a redirect (#514)
Closes #510
2019-04-30 15:15:41 -07:00
Guillaume Gomez
66a88d946b Add doc-comment to test README examples (#515) 2019-04-30 14:11:10 -07:00
Ziyang Li
40550aec7a Allow user to specify a default encoding when reading Response to text (#511)
Add a function `text_with_charset` which allows the user to provide a default charset encoding. The behavior of this still prefers the provided charset inside the http header over the provided default encoding.
2019-04-29 11:47:01 -07:00
Sean McArthur
6df910a61c re-add Error::cause() impl 2019-04-25 18:36:31 -07:00
Sean McArthur
29f7fa74cc combine ClientError and ServerError into Status kind 2019-04-25 10:54:55 -07:00
Sean McArthur
45484d8077 implement Error::source() 2019-04-25 10:45:30 -07:00
Sean McArthur
17850942c8 remove some noise from Error debug format 2019-04-25 10:32:53 -07:00
Sean McArthur
e4b91ad201 improve error messages from gzip decoder 2019-04-25 10:28:13 -07:00
quininer
6fe3d6a8a0 fix gzip + chunked encoding reuse of connection (#509)
Closes #508
2019-04-25 09:46:39 -07:00
Adilson Neto
f798a8b2df Remove trailing '?' on empty query. (#506)
Closes #464
2019-04-24 17:36:24 -07:00
Chen Rotem Levy
265065f20d Typo in rustdoc (#507)
s/certicates/certificates/
2019-04-24 10:29:23 -07:00
Sean McArthur
f6ce085457 Propagate async timeout to response body (#503) 2019-04-22 15:24:35 -07:00
Sean McArthur
ce51fe83d6 Add request timeout support to async Client (#501)
Closes #496
2019-04-22 12:43:30 -07:00
Sean McArthur
08054a3984 v0.9.15 2019-04-15 12:36:27 -07:00
Jerome Gravel-Niquet
77434a29aa Fix overwriting of appended request headers (#493)
* don't overwrite appended user headers

* Fixes tests, all header ordering related

* does not need to clone default headers, added a test
2019-04-15 12:33:03 -07:00
Sean McArthur
9ddeb5ad22 v0.9.14 2019-04-09 13:13:53 -07:00
Sean McArthur
8ee46f89f8 update docs and readme about cookies and socks 2019-04-09 12:57:53 -07:00
Sean McArthur
f9e88b0928 use Cookie constructor instead of Self() 2019-04-09 12:54:10 -07:00
Christoph Herzog
9935a8e117 CookieStore cleanup/fixes
* Remove TODO
* Remove Cookie::set_ setters
* Do not expose SameSite enum, provide getters on Cookie instead
* Simplify Response::cookies signature (now ignores errors)
2019-04-09 12:54:10 -07:00
Christoph Herzog
954fdfae30 Implement cookie store support
This commit introduces a cookie store / session support
for both the async and the sync client.

Functionality is based on the cookie crate,
which provides a HTTP cookie abstraction,
and the cookie_store crate which provides a
store that handles cookie storage and url/expiration
based cookie resolution for requests.

Changes:
* adds new private dependencies: time, cookie, cookie_store
* a new cookie module which provides wrapper types around
    the dependency crates
* a Response::cookies() accessor for iterating over response cookies
* a ClientBuilder::cookie_store() method that enables session functionality
* addition of a cookie_store member to the async client
* injecting request cookies and persisting response cookies
* cookie tests

NOTE: this commit DOES NOT expose the CookieStore itself,
limiting available functionality.

This is desirable, but omitted for now due to API considerations that should be fleshed out in the future.
This means users do not have direct access to the cookie session for now.
2019-04-09 12:54:10 -07:00
Diggory Blake
c45ff29bfb Add support for SOCKS5 proxies, and parsing proxy authorizations from URLs 2019-04-08 11:42:18 -07:00