Attempt to get nonexisting bucket results in HTTP 200 OK

Jim Meyering jim at meyering.net
Wed Feb 23 21:23:06 UTC 2011


Maros Zatko wrote:
> ISSUE: Attempt to get nonexisting bucket results in HTTP 200 OK.
>
> step 1:
>     $ curl http://localhost:9090/this_doesnt_exist -i
>     HTTP/1.1 200 OK
>     Transfer-Encoding: chunked
>     Date: Tue, 22 Feb 2011 14:01:04 GMT
>
> <objects>
> </objects>
>
> Bucket is either empty or it doesn't exist in a first place.
> There is no way to distinguish between these with current behaviour of IWHD.

Yes, that is a problem.
Thanks for the fine report.

What would be better, a 404 with no output,
or (probably easier to implement) output this instead of the above:

<objects>
something indicating the bucket does not exist
</objects>

> step 2:
>     $ curl -X PUT http://localhost:9090/this_doesnt_exist/asdf -i
>     HTTP/1.1 500 Internal Server Error
>     Content-Length: 0
>     Date: Tue, 22 Feb 2011 14:08:27 GMT

500 doesn't seem right here, either.

> Let's look at the case when we create bucket.
>
> step 0:
>     $ curl -X PUT http://localhost:9090/this_does_exist -i
>     HTTP/1.1 200 OK
>     Content-Length: 0
>     Date: Tue, 22 Feb 2011 14:07:50 GMT
>
> step 1:
>     $ curl http://localhost:9090/this_does_exist -i
>     HTTP/1.1 200 OK
>     Transfer-Encoding: chunked
>     Date: Tue, 22 Feb 2011 14:07:54 GMT
>
> <objects>
> </objects>
>
> step 2:
>     $ curl -X PUT http://localhost:9090/this_does_exist/asdf -i
>     HTTP/1.1 200 OK
>     Content-Length: 0
>     ETag: f9d8b8daf058d341
>     Date: Tue, 22 Feb 2011 14:08:42 GMT
>
> The behaviour of step 1 should be different (more rest-like; now throw
> rocks at me).

No rock throwing from me, but converting all of iwhd
to be nicely RESTful doesn't seem appropriate right now.

In any case, what restful output would you suggest for #1?
A structured document containing a URL by which to create
the nonexistent object?


More information about the iwhd-devel mailing list