Improve create bucket error handling

Found with Ceph s3-tests.  References #5.
pull/16/head
Andrew Gaul 2014-07-29 01:20:28 -07:00
rodzic 5c843eb272
commit f698bd68e8
1 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -248,6 +248,21 @@ final class S3ProxyHandler extends AbstractHandler {
private void handleContainerCreate(HttpServletResponse response,
String containerName) {
if (containerName.isEmpty()) {
sendSimpleErrorResponse(response,
HttpServletResponse.SC_METHOD_NOT_ALLOWED,
"MethodNotAllowed", "Method Not Allowed",
Optional.<String>absent());
return;
}
if (containerName.length() < 3 || containerName.length() > 255) {
sendSimpleErrorResponse(response,
HttpServletResponse.SC_BAD_REQUEST,
"InvalidBucketName", "Bad Request",
Optional.<String>absent());
return;
}
try {
// TODO: how to support locations?
Location location = null;