This repository has been archived by the owner on May 10, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In reaction to #2078 (& the mentioned blog post), this pull alters the behavior of
S3Connection.get_bucket
. This switches from the old approach of trying to fetch keys in the bucket to utilizingHeadBucket
.Some further notes. I back-ported the old method to
GSConnection
, since it doesn't appear Google Storage supportsHEAD
on a bucket - https://developers.google.com/storage/docs/reference-methods. I'd love to be corrected on this, but for now, I copied over the old behavior. I don't have a GS account to test with, so I'm really hoping I didn't break it. 馃槙Beyond that, this is mostly backward-compatible (& less expensive). The only thing that hurts is that
HEAD
requests (rightfully) don't include a body, but that makes the creation ofS3ResponseError
worse because there are no details. I faked in the common cases, but if anyone was parsing this before, they're going to have to alter their code. I've documented how they should approach that.Review please? @jamesls @danielgtaylor @garnaat @mfschwartz