Skip to content

Commit

Permalink
Fix s3tests.functional.test_s3:test_bucket_list_maxkeys_zero
Browse files Browse the repository at this point in the history
  • Loading branch information
mocchira committed Jul 3, 2015
1 parent 66ad3b5 commit 37c677f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/leo_gateway_s3_api.erl
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,13 @@ get_bucket_1(AccessKeyId, ?BIN_SLASH, _Delimiter, _Marker, _MaxKeys, none) ->
Error
end;

get_bucket_1(_AccessKeyId, Bucket, _Delimiter, _Marker, 0, Prefix) ->
Prefix_1 = case Prefix of
none -> <<>>;
_ -> Prefix
end,
Key = << Bucket/binary, Prefix_1/binary >>,
{ok, [], generate_bucket_xml(Key, Prefix_1, [], 0)};
get_bucket_1(_AccessKeyId, Bucket, Delimiter, Marker, MaxKeys, Prefix) ->
Prefix_1 = case Prefix of
none -> <<>>;
Expand Down Expand Up @@ -1075,7 +1082,7 @@ generate_bucket_xml(KeyBin, PrefixBin, MetadataList, MaxKeys) ->
Len = byte_size(KeyBin),
Key = binary_to_list(KeyBin),
Prefix = binary_to_list(PrefixBin),
TruncatedStr = case length(MetadataList) =:= MaxKeys of
TruncatedStr = case length(MetadataList) =:= MaxKeys andalso MaxKeys =/= 0 of
true -> "true";
false -> "false"
end,
Expand Down

0 comments on commit 37c677f

Please sign in to comment.