Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix utf-8 encoding issue for bucket lifecycle #1180
@garnaat - AWS seems to have a bug with multi-byte prefixes for the bucket policy. As far as I can see the request on the network is correctly encoded yet and has the correct bytes. The response to the get lifecycle request from AWS however is wrong and only contains ??? (one for each multibyte character - so AWS is actually decoding the utf-8 in the request) instead of the expected utf-8 bytes. The patch is still useful though and is worth applying as-is I think? ie, it adds a unit test and fixes the configure lifecycle request. I also tried using a multibyte id, but it has the same issue.
I added another commit to this fetch. I'm open to rework this a little based on review.
Basically the lifecycle object was missing date support and the implementation was different between expiration and transition. I fixed this up by making the expiration instance variable an object instead of an integer representation of days as it was before. I think that in the long run this is better. I kept setting of the expiration parameter as an integer number of days or the Expiration object (which is preferred I guess). The only thing that might brake is if someone directly accesses the rule.expiration and expects it to be an integer instead of the Expiration object. I guess some folks could also be setting rule.expiration manually to an integer also...
Anyway - any feedback welcome. I think this is better than before.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I agree that making the expiration and transition more consistent with each other is better in the long run. I'm not sure whether or not people are accessing rule.expiration directly (I'll defer to @garnaat for that), but one of the unittests does this to verify the expiration object is the correct value, and it is now failing:
(To run the unit tests, you can use