Emit NoSuchBucket on write to non-existent bucket

Found with Ceph s3-tests.  References #5.
pull/16/head
Andrew Gaul 2014-07-29 12:06:39 -07:00
rodzic b603abefc8
commit 1284c91e37
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -572,6 +572,11 @@ final class S3ProxyHandler extends AbstractHandler {
try {
String eTag = blobStore.putBlob(containerName, builder.build());
response.addHeader(HttpHeaders.ETAG, "\"" + eTag + "\"");
} catch (ContainerNotFoundException cnfe) {
sendSimpleErrorResponse(response,
HttpServletResponse.SC_NOT_FOUND, "NoSuchBucket",
"Not Found", Optional.<String>absent());
return;
} catch (HttpResponseException hre) {
int status = hre.getResponse().getStatusCode();
if (status == HttpServletResponse.SC_BAD_REQUEST) {