aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/list.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-01-26 15:17:09 +0000
committerAlex <alex@adnab.me>2023-01-26 15:17:09 +0000
commit5fb383fe4c248181e27df12a57849886e50bacb7 (patch)
tree004e5b3649dd01843b00922e0f5266a1973c0d18 /src/api/s3/list.rs
parent1311742fe07ca619d1f37f9f1eabd07ee0d141db (diff)
parent0da054194b7e063b09f1354bcde739247725688b (diff)
downloadgarage-5fb383fe4c248181e27df12a57849886e50bacb7.tar.gz
garage-5fb383fe4c248181e27df12a57849886e50bacb7.zip
Merge pull request 'cargo: Bump dependencies to latest version' (#484) from jpds/garage:cargo-bumps into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/484
Diffstat (limited to 'src/api/s3/list.rs')
-rw-r--r--src/api/s3/list.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/api/s3/list.rs b/src/api/s3/list.rs
index e5f486c8..5cb0d65a 100644
--- a/src/api/s3/list.rs
+++ b/src/api/s3/list.rs
@@ -3,6 +3,7 @@ use std::collections::{BTreeMap, BTreeSet};
use std::iter::{Iterator, Peekable};
use std::sync::Arc;
+use base64::prelude::*;
use hyper::{Body, Response};
use garage_util::data::*;
@@ -129,11 +130,11 @@ pub async fn handle_list(
next_continuation_token: match (query.is_v2, &pagination) {
(true, Some(RangeBegin::AfterKey { key })) => Some(s3_xml::Value(format!(
"]{}",
- base64::encode(key.as_bytes())
+ BASE64_STANDARD.encode(key.as_bytes())
))),
(true, Some(RangeBegin::IncludingKey { key, .. })) => Some(s3_xml::Value(format!(
"[{}",
- base64::encode(key.as_bytes())
+ BASE64_STANDARD.encode(key.as_bytes())
))),
_ => None,
},
@@ -583,14 +584,16 @@ impl ListObjectsQuery {
(Some(token), _) => match &token[..1] {
"[" => Ok(RangeBegin::IncludingKey {
key: String::from_utf8(
- base64::decode(token[1..].as_bytes())
+ BASE64_STANDARD
+ .decode(token[1..].as_bytes())
.ok_or_bad_request("Invalid continuation token")?,
)?,
fallback_key: None,
}),
"]" => Ok(RangeBegin::AfterKey {
key: String::from_utf8(
- base64::decode(token[1..].as_bytes())
+ BASE64_STANDARD
+ .decode(token[1..].as_bytes())
.ok_or_bad_request("Invalid continuation token")?,
)?,
}),