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

Mandatory base URL support in config #342

Open joshtriplett opened 2 years ago

joshtriplett commented 2 years ago

I'd like to set a flag in Config that forces the resulting Client to only use URIs relative to the specified base URI, and never support absolute URIs.

This would add security when providing authentication: the config could add_header a header containing authentication information, and also set a mandatory base URI to ensure that the Client can't accidentally pass that authentication information to any other domain.

joshtriplett commented 2 years ago

https://github.com/http-rs/surf/pull/343