feat: add readme

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2026-02-27 11:44:20 +01:00
parent 21bac4a33f
commit e53a313549
2 changed files with 179 additions and 10 deletions

View File

@@ -10,7 +10,7 @@ use crate::state::State as AppState;
fn is_valid_bucket_name(name: &str) -> bool {
let len = name.len();
if len < 3 || len > 63 {
if !(3..=63).contains(&len) {
return false;
}
// Must contain only lowercase letters, numbers, hyphens, and periods
@@ -30,11 +30,7 @@ fn is_valid_bucket_name(name: &str) -> bool {
return false;
}
// Must not be formatted as an IP address
if name.split('.').count() == 4
&& name
.split('.')
.all(|part| part.parse::<u8>().is_ok())
{
if name.split('.').count() == 4 && name.split('.').all(|part| part.parse::<u8>().is_ok()) {
return false;
}
true
@@ -166,10 +162,7 @@ pub async fn list_buckets<B: StorageBackend>(
StatusCode::OK,
[
("Content-Type", "application/xml".to_string()),
(
"x-amz-request-id",
uuid::Uuid::new_v4().to_string(),
),
("x-amz-request-id", uuid::Uuid::new_v4().to_string()),
],
responses::list_buckets_xml(&buckets),
)