Function garage_api::helpers::host_to_bucket
source · pub fn host_to_bucket<'a>(host: &'a str, root: &str) -> Option<&'a str>
Expand description
Host to bucket
Convert a host, like “bucket.garage-site.tld” to the corresponding bucket “bucket”, considering that “.garage-site.tld” is the “root domain”. For domains not matching the provided root domain, no bucket is returned This behavior has been chosen to follow AWS S3 semantic.