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

Trailing slash redirects #276

Closed hipstermojo closed 3 years ago

hipstermojo commented 3 years ago

When using the default redirect middleware on surf, I noticed that it exits early when the next redirected URL is invalid. However, I think this is recoverable if the next location is a relative URL. This was the case when surf requests a URL without a trailing slash and the server redirects to a URL with a trailing slash. I made a fix for it and wanted to know if it is worth making a PR for. I saw that something similar was mentioned in #252.

Fishrock123 commented 3 years ago

@hipstermojo Please send a PR