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

base_url "/" handling #255

Open Fishrock123 opened 3 years ago

Fishrock123 commented 3 years ago

Taken from https://github.com/http-rs/surf/pull/252#issuecomment-707942927

base_url acts in unexpected ways when a trailing slash is missing. See that PR for more details.

ericsampson commented 2 years ago

there's a spec for this, RFC

So AFAIC what's described in #252 as a "bug" is actually correct behavior by the underlying library.

For example, the .NET HttpClient documentation has this note:

Note that all characters after the right-most "/" in the base URI are excluded when combined with the message URI. See RFC 3986 Uniform Resource Identifier (URI) Generic Syntax specification.