http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.46k stars 120 forks source link

Client: make Clone create a new middleware stack #208

Closed Fishrock123 closed 4 years ago

Fishrock123 commented 4 years ago

This allows an easier way of having Clients with a shared HttpClient, but with potentially different middleware.

Closes #205

Requires https://github.com/http-rs/surf/pull/194

Fishrock123 commented 4 years ago

To clarify here: the middleware when cloned is still the same, reference-based individual middleware, but the stack is new, so that changes to the new client's stack are not reflected in any client it was cloned from.