Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding for prefix and commonPrefixes #5239

Merged
merged 1 commit into from Jun 17, 2022

Conversation

pinzon
Copy link
Contributor

@pinzon pinzon commented Jun 16, 2022

This pr addresses issue #5228. Now that the list_objects_v2 response has the EncodingType attribute, Boto3 tries to decode the attributes Prefix and the CommonPrefixes like with the name of a Key Object.

Changes:

  • Encoding of Prefix and CommonPrefixes if necessary.
  • The added test groups the multiple reproducers provided in the issue.

@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2022

Codecov Report

Merging #5239 (079eaa9) into master (6a1a8ee) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #5239   +/-   ##
=======================================
  Coverage   95.86%   95.86%           
=======================================
  Files         688      688           
  Lines       68240    68244    +4     
=======================================
+ Hits        65419    65423    +4     
  Misses       2821     2821           
Flag Coverage Δ
servertests 36.39% <25.00%> (-0.01%) ⬇️
unittests 95.80% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
moto/s3/responses.py 95.51% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a1a8ee...079eaa9. Read the comment docs.

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one - thanks for fixing this @pinzon!

@bblommers bblommers merged commit a44a9df into getmoto:master Jun 17, 2022
@bblommers bblommers added this to the 3.1.14 milestone Jun 17, 2022
@github-actions
Copy link
Contributor

This is now part of moto >= 3.1.14.dev15

sahilshah6196 pushed a commit to EBSCOIS/moto that referenced this pull request Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: Prefixes in S3 listing are unquoted and don't match the Key
3 participants