http-rs / surf

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

Add fix for redirect middleware for #276 #279

Closed hipstermojo closed 3 years ago

hipstermojo commented 3 years ago

This fix will require a clone of the original base URL which can then be joined to the value in the LOCATION header if it is a relative path. Previously this would simply return an Error for RelativeURLWithoutBase.

An example of such a URL is https://blog.thomasheartman.com/posts/on-generics-and-associated-types which would redirect to add a trailing slash.

hipstermojo commented 3 years ago

The linting issues with Clippy are technically outside the scope of this PR so I'm not sure if I should edit that part or not.

Fishrock123 commented 3 years ago

Merged the exact same commits in https://github.com/http-rs/surf/pull/293 - for some reason there was still a rebase issue here.

Thanks!!