qoobaa/s3

When creating an object first try to GET it

Opened this issue · 2 comments

Guys, I'm trying to create a simple object but when I do it, it first run a GET and of corse since the resource doesn't exists it rise an exception:

s = my_bucket.objects.build "holaaaa/"
s.save
opening connection to my_bucket.s3.amazonaws.com:80...
opened
<- "GET /holaaaa/? HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nDate: Tue, 18 Oct 2016 17:03:03 GMT\r\nAuthorization: AWS xxxxxxx=\r\nHost: my_bucket.s3.amazonaws.com\r\n\r\n"
-> "HTTP/1.1 404 Not Found\r\n"

Is this the expected behavior?

UPDATED: The problem is when you don't set the content of the file.

I haven't used it for a while, so I'm not sure if this is an expected behavior. If you think it is, feel free to create a PR with a test case.

It shouldn't really be the expected behavior, will try to work on a PR. Thanks!