mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-02 19:36:45 +00:00
uri: drop anyhow::Error and improve docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
ca9dd7ec36
commit
c9b4a4f39b
@ -135,7 +135,7 @@ impl hyper::service::Service<Uri> for HttpsConnector {
|
||||
|
||||
let proxy_authority = match build_authority(&proxy.host, proxy.port) {
|
||||
Ok(authority) => authority,
|
||||
Err(err) => return futures::future::err(err).boxed(),
|
||||
Err(err) => return futures::future::err(err.into()).boxed(),
|
||||
};
|
||||
|
||||
let proxy_uri = match Uri::builder()
|
||||
|
@ -1,9 +1,10 @@
|
||||
use anyhow::Error;
|
||||
//! URI Related helpers, such as `build_authority`
|
||||
|
||||
use http::uri::Authority;
|
||||
use http::uri::{Authority, InvalidUri};
|
||||
|
||||
// Build a http::uri::Authority ("host:port"), use '[..]' around IPv6 addresses
|
||||
pub fn build_authority(host: &str, port: u16) -> Result<Authority, Error> {
|
||||
// Build an [`Authority`](http::uri::Authority) from a combination of `host` and `port`, ensuring that
|
||||
// IPv6 addresses are enclosed in brackets.
|
||||
pub fn build_authority(host: &str, port: u16) -> Result<Authority, InvalidUri> {
|
||||
let bytes = host.as_bytes();
|
||||
let len = bytes.len();
|
||||
let authority =
|
||||
|
Loading…
Reference in New Issue
Block a user