aboutsummaryrefslogtreecommitdiff
path: root/src/api/helpers.rs
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-11-15 17:39:36 +0100
committerGitea <gitea@fake.local>2021-11-16 15:41:41 +0100
commit53888995bdd7c672d2e3ab8bb6a3529195c127a9 (patch)
tree9092c0e56a3b580973fec9afd735ada64e1029be /src/api/helpers.rs
parentf0893b904d2cd9c5e7bedf5205272be5d0c01a33 (diff)
downloadgarage-53888995bdd7c672d2e3ab8bb6a3529195c127a9.tar.gz
garage-53888995bdd7c672d2e3ab8bb6a3529195c127a9.zip
update doc and comments
Diffstat (limited to 'src/api/helpers.rs')
-rw-r--r--src/api/helpers.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/helpers.rs b/src/api/helpers.rs
index 9ba32537..2375d35d 100644
--- a/src/api/helpers.rs
+++ b/src/api/helpers.rs
@@ -3,9 +3,9 @@ use idna::domain_to_unicode;
/// Host to bucket
///
-/// Convert a host, like "bucket.garage-site.tld" or "john.doe.com"
-/// to the corresponding bucket, resp. "bucket" and "john.doe.com"
-/// considering that ".garage-site.tld" is the "root domain".
+/// 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.
pub fn host_to_bucket<'a>(host: &'a str, root: &str) -> Option<&'a str> {
let root = root.trim_start_matches('.');