Commit Graph

304 Commits

Author SHA1 Message Date
Jeremiah Senkpiel de0e5e5eee
Merge pull request #344 from Fishrock123/fix-clippy-lints
lints: fix clippy lints
2022-05-09 17:49:46 -07:00
Jeremiah Senkpiel cd3ba3ed4d lints: fix clippy lints 2022-05-09 17:40:01 -07:00
Jeremiah Senkpiel 726748de61
Merge pull request #337 from misuzu/additive-features
Allow building with `--all-features`
2022-01-27 10:02:56 -08:00
misuzu e60727afe1 Allow building with `--all-features`.
`h1-client-rustls` is preferred when `h1-client` is also enabled.
2022-01-13 15:57:51 +02:00
Jeremiah Senkpiel 876912d59e 2.3.2
### Fixes
- Fixed `Config::set_tls_config()` when using `h1-client` (`async-h1` with `async-native-tls`).
    - Previously this function was never exposed due to a faulty feature flag check.
2021-11-01 12:41:31 -07:00
Jeremiah Senkpiel 5a8dc31b61
Merge pull request #327 from deltachat/h1-client-feature
Fix a typo in `set_tls_config` h1-client feature check
2021-11-01 12:01:06 -07:00
link2xt 1cddf3f9e3 ci: skip h1-client,h1-client-rustls 2021-11-01 18:11:19 +00:00
link2xt dddbde442a Fix a typo in `set_tls_config` h1-client feature check 2021-10-31 09:48:04 +00:00
Jeremiah Senkpiel ebeb770791
Merge pull request #323 from brightly-salty/no-tls-option
Add h1-client-no-tls feature flag
2021-08-30 10:41:47 -07:00
Caden Haustein fadb0686d7 Fix remaining issue 2021-08-27 15:43:29 -05:00
Caden Haustein 6d16cfc239 Add h1-client-no-tls feature flag 2021-08-26 15:19:15 -05:00
Jeremiah Senkpiel dedb6f42e0 2.3.1
## [2.3.1] - 2021-08-23

Fixed git base of 2.3.0

## [2.3.0] - 2021-08-23

(Yanked, faulty git base)

### Additions
- `surf::Config`, a way to configure `surf::Client`-s!
    - `Config::add_header()` - client-wide headers
    - `Config::set_base_url()` - client-wide base url
    - `Config::set_http_keep_alive()`
    - `Config::set_tcp_no_delay()`
    - `Config::set_timeout()` - per-request timeout.
    - `Config::set_max_connections_per_host()`
    - `Config::set_tls_config()` - only available on `h1-client` or `h1-client-rustls`.
    - More config may be available from the underlying [`http_client::Config`](https://docs.rs/http-client/6/http_client/struct.Config.html).
    - Easily turns into a `Client` via `std::convert::TryInto`.
- Extra `RequestBuilder` helpers for setting the body from different sources.
    - `body_json()`, `body_string()`, `body_bytes()`, `body_file()`.
- `Client::request()` for making arbitrary HTTP-method requests from a client.

### Improvements
- The `h1-client` backend now uses a shared client for 'one-off' style (`surf::get()`, etc) requests.
    - The `curl-client` and `hyper-client` backends already did this.
- The `wasm-client` feature now pulls in `getrandom`'s `"js"` feature.
    - This isn't a problem since the wasm client only works in a web/emscripten environment anyways.

### Deprecations
- `Client::set_base_url` has been deprecated in favor of `Config`.

### Docs
- Several docs fixes
- Minor 'branding' changes
2021-08-23 15:43:16 -07:00
Jeremiah Senkpiel 9a0735e79a 2.3.0
## [2.3.0] - 2021-08-23

### Additions
- `surf::Config`, a way to configure `surf::Client`-s!
    - `Config::add_header()` - client-wide headers
    - `Config::set_base_url()` - client-wide base url
    - `Config::set_http_keep_alive()`
    - `Config::set_tcp_no_delay()`
    - `Config::set_timeout()` - per-request timeout.
    - `Config::set_max_connections_per_host()`
    - `Config::set_tls_config()` - only available on `h1-client` or `h1-client-rustls`.
    - More config may be available from the underlying [`http_client::Config`](https://docs.rs/http-client/6/http_client/struct.Config.html).
    - Easily turns into a `Client` via `std::convert::TryInto`.
- Extra `RequestBuilder` helpers for setting the body from different sources.
    - `body_json()`, `body_string()`, `body_bytes()`, `body_file()`.
- `Client::request()` for making arbitrary HTTP-method requests from a client.

### Improvements
- The `h1-client` backend now uses a shared client for 'one-off' style (`surf::get()`, etc) requests.
    - The `curl-client` and `hyper-client` backends already did this.
- The `wasm-client` feature now pulls in `getrandom`'s `"js"` feature.
    - This isn't a problem since the wasm client only works in a web/emscripten environment anyways.

### Deprecations
- `Client::set_base_url` has been deprecated in favor of `Config`.

### Docs
- Several docs fixes
- Minor 'branding' changes
2021-08-23 15:41:16 -07:00
Jeremiah Senkpiel f62863c270
Merge pull request #320 from Fishrock123/config-set-tls-config
feat: add `Config::set_tls_config()` (h1 only)
2021-08-23 15:31:58 -07:00
Jeremiah Senkpiel f4e2899e25
Merge pull request #319 from Fishrock123/fix-config-docs
docs: improve Config docs
2021-08-23 15:21:19 -07:00
Jeremiah Senkpiel 9e75a014c1 feat: add `Config::set_tls_config()` (h1 only)
Adds `Config::set_tls_config()` like `http-client` has. Note that this only works with the async-h1 `h1-client`, which is not yet the default.
2021-08-23 15:12:16 -07:00
Jeremiah Senkpiel 60da01594c docs: improve Config docs
more similar to the `http-client` docs with listed defaults and such.
2021-08-23 15:03:51 -07:00
Jeremiah Senkpiel ebb3732cc3
Merge pull request #318 from Fishrock123/readme-updates
docs: readme updates for 2.3
2021-08-23 14:44:47 -07:00
Jeremiah Senkpiel 79a201576c docs: readme updates for 2.3
Update the branding a bit.
2021-08-23 12:50:19 -07:00
Jeremiah Senkpiel cbfac4a908
Merge pull request #310 from Fishrock123/config
feat: add Config for surf
2021-08-23 11:11:21 -07:00
Jeremiah Senkpiel 6ca7ad8d55 feat: add Config for surf
Finally adds top-level configuration to surf, built on top of http-client's
newly stabilized `Config`.

Related to https://github.com/http-rs/http-client/pull/86

Closes https://github.com/http-rs/surf/issues/274
Closes https://github.com/http-rs/surf/issues/277
2021-08-23 11:01:10 -07:00
Jeremiah Senkpiel 1ffaba8873
Merge pull request #316 from jkelleyrtp/jk/fix-the-wasm
fix: pin getrandom to work on wasm
2021-07-29 13:51:10 -07:00
Jonathan Kelley dc16839867 fix: use regular feature flags 2021-07-28 10:55:00 -04:00
Jonathan Kelley 3169207aff feat: target the wasm-client feature 2021-07-27 20:09:27 -04:00
Jonathan Kelley fe19210007 fix: pin getrandom to work on wasm 2021-07-27 15:44:52 -04:00
Jeremiah Senkpiel b1fc45c837
Merge pull request #308 from utsavm9/main
RequestBuilder from Client and user-provided method
2021-06-30 10:50:38 -07:00
Utsav Munendra 84c46d14d9 Fix doc code of client response() 2021-06-29 16:12:12 -07:00
Jeremiah Senkpiel a12d3d54ce
Merge pull request #309 from Fishrock123/fix-wasm-tests
tests: fix wasm tests by setting a getrandom feature
2021-06-29 14:29:19 -07:00
Jeremiah Senkpiel 280016899f tests: fix wasm tests by setting a getrandom feature
See https://docs.rs/getrandom/0.2.3/getrandom/#unsupported-targets
2021-06-29 14:20:05 -07:00
Utsav Munendra e20eb8f403 RequestBuilder from Client and user-provided method 2021-06-24 18:41:17 -07:00
Jeremiah Senkpiel 74e4884648
Merge pull request #294 from Fishrock123/share-h1-client
feat: globally share h1 client
2021-06-09 10:55:49 -07:00
Jeremiah Senkpiel 190f1dbde7 feat: globally share h1 client
This takes advantage of the new connection pooling in the
async-h1 client for the globally shared client, similar to
the isahc and hyper clients.
2021-06-09 10:28:50 -07:00
Jeremiah Senkpiel a7b5bcdbad fix: clippy warnings
See https://github.com/rust-lang/rust-clippy/issues/6958
2021-06-09 10:28:24 -07:00
R Tyler Croy b5917bff26 Correct a minor documentation typo
Pretty sure this is supposed to mean "response" not "request"
2021-06-05 22:12:37 -07:00
Jeremiah Senkpiel 5462b3f4d4
Merge pull request #302 from http-rs/body-types-request-builder
Add specialized body types to `RequestBuilder`
2021-04-29 15:20:41 -07:00
Jeremiah Senkpiel 647b1c5e0c
request_builder: tweak docs 2021-04-29 14:47:30 -07:00
Yoshua Wuyts 3fba494f8c Update request.rs 2021-04-29 19:39:51 +02:00
Yoshua Wuyts cf9b9982c5 Add specialized body types to `RequestBuilder` 2021-04-29 19:04:47 +02:00
Jeremiah Senkpiel fb228d8536 2.2.0
If you use the `h1-client`, upgrading to this release is recommended.

- `h1-client-rustls` feature flag, for using the [`async-h1`](https://github.com/http-rs/async-h1) client with [`rustls`](https://github.com/ctz/rustls) as the TLS backend.
    - The TLS backend for `h1-client` is still `async-native-tls`.
- Per-request middleware, provided by `RequestBuilder::middleware(&mut self, impl Middleware)`.
- `AsRef<Headers>` and `AsMut<Headers>` for `surf::Request` and `surf::Response`.

- Relative redirects should now be handled by the `RedirectMiddleware`.
- The `h1-client` feature should now properly work with `http-client` 6.3.0+ without additional feature specification.

- The `http` docs now link to the live, up-to-date `http_types` docs.

- Various CI improvements.
2021-03-02 11:22:07 -08:00
Jeremiah Senkpiel d4943aa6cf
Merge pull request #293 from Fishrock123/fix-redirects
Fix relative redirects
2021-03-01 15:10:05 -08:00
Kenneth Gitere c32ee64b82 Update `base_url` with each redirect of a full URL 2021-03-01 14:50:35 -08:00
Kenneth Gitere 16a9ab948a Add fix for redirect middleware for #276 2021-03-01 14:50:35 -08:00
Jeremiah Senkpiel 5a5621b107
Merge pull request #292 from Fishrock123/h1-client-rustls
Add 'h1-client-rustls' feature relying on rustls
2021-03-01 14:34:46 -08:00
Jeremiah Senkpiel 1adb821252 Add 'h1-client-rustls' feature relying on rustls
This PR is a follow-up of http-rs/http-client#53 and addresses #40.
It adds a `h1-client-rustls` feature using `http-client/rustls` feature introduced by http-rs/http-client#53.

Co-Authored-By: Julien Enoch <julien.enoch@adlinktech.com>
2021-03-01 13:08:30 -08:00
Jeremiah Senkpiel f8d02c37a9
Merge pull request #291 from Fishrock123/fix-http-client-features
Fix http client features
2021-03-01 11:57:05 -08:00
Jeremiah Senkpiel cbd2185fbc Revert default-client changes
This was changed in the previous commit when it didn't need to be 3a56e67
2021-03-01 11:12:39 -08:00
Taiki Endo 3a56e6708a Fix h1-client and default-client feature
This also adds a CI task to check all feature combinations work properly.
2021-03-01 09:55:34 -08:00
Jeremiah Senkpiel fc75a59cf8 fix: clippy nightly updated lint 2021-02-12 08:46:48 -08:00
Jeremiah Senkpiel 651b82f5d3
Merge pull request #266 from Fishrock123/per-request-middleware
feat: add per-request middleware
2021-02-11 15:56:24 -08:00
Jeremiah Senkpiel e30aa7cf26
Merge pull request #263 from Fishrock123/ci-improvements
ci improvements
2021-01-18 17:07:20 -08:00