Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TeDomum
Garage
Commits
36814be4
Commit
36814be4
authored
Jan 16, 2021
by
Alex Auvolat
Browse files
Fix S3 ListObjects result and replace println!s by debug!s
parent
6a5add33
Changes
3
Hide whitespace changes
Inline
Side-by-side
script/dev-cluster.sh
View file @
36814be4
...
...
@@ -10,7 +10,7 @@ PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH"
FANCYCOLORS
=(
"41m"
"42m"
"44m"
"45m"
"100m"
"104m"
)
export
RUST_BACKTRACE
=
1
export
RUST_LOG
=
garage
=
info
export
RUST_LOG
=
garage
=
info
,garage_api
=
debug
MAIN_LABEL
=
"
\e
[
${
FANCYCOLORS
[0]
}
[main]
\e
[49m"
WHICH_GARAGE
=
$(
which garage
||
exit
1
)
...
...
src/api/api_server.rs
View file @
36814be4
...
...
@@ -173,7 +173,7 @@ async fn handler_inner(garage: Arc<Garage>, req: Request<Body>) -> Result<Respon
&
Method
::
PUT
=>
{
// CreateBucket
// If we're here, the bucket already exists, so just answer ok
println
!
(
debug
!
(
"Body: {}"
,
std
::
str
::
from_utf8
(
&
hyper
::
body
::
to_bytes
(
req
.into_body
())
.await
?
)
.unwrap_or
(
"<invalid utf8>"
)
...
...
@@ -229,7 +229,7 @@ async fn handler_inner(garage: Arc<Garage>, req: Request<Body>) -> Result<Respon
// DeleteObjects
Ok
(
handle_delete_objects
(
garage
,
bucket
,
req
)
.await
?
)
}
else
{
println
!
(
debug
!
(
"Body: {}"
,
std
::
str
::
from_utf8
(
&
hyper
::
body
::
to_bytes
(
req
.into_body
())
.await
?
)
.unwrap_or
(
"<invalid utf8>"
)
...
...
src/api/s3_list.rs
View file @
36814be4
...
...
@@ -150,8 +150,8 @@ pub async fn handle_list(
writeln!
(
&
mut
xml
,
"
\t
</Contents>"
)
.unwrap
();
}
if
result_common_prefixes
.len
()
>
0
{
writeln!
(
&
mut
xml
,
"
\t
<CommonPrefixes>"
)
.unwrap
();
for
pfx
in
result_common_prefixes
.iter
()
{
writeln!
(
&
mut
xml
,
"
\t
<CommonPrefixes>"
)
.unwrap
();
writeln!
(
&
mut
xml
,
"
\t\t
<Prefix>{}</Prefix>"
,
...
...
@@ -159,11 +159,11 @@ pub async fn handle_list(
//xml_encode_key(pfx, urlencode_resp)
)
.unwrap
();
writeln!
(
&
mut
xml
,
"
\t
</CommonPrefixes>"
)
.unwrap
();
}
writeln!
(
&
mut
xml
,
"
\t
</CommonPrefixes>"
)
.unwrap
();
}
writeln!
(
&
mut
xml
,
"</ListBucketResult>"
)
.unwrap
();
println
!
(
"{}"
,
xml
);
debug
!
(
"{}"
,
xml
);
Ok
(
Response
::
new
(
Body
::
from
(
xml
.into_bytes
())))
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment