Allow anonymous HEAD object on public-read objects

pull/102/merge
Andrew Gaul 2015-12-22 18:41:15 -08:00
rodzic 024c7a3fe9
commit 118b656f8e
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -618,9 +618,18 @@ final class S3ProxyHandler extends AbstractHandler {
if (!blobStore.containerExists(containerName)) {
throw new S3Exception(S3ErrorCode.NO_SUCH_BUCKET);
}
return;
} else {
String containerName = path[1];
String blobName = path[2];
BlobAccess access = blobStore.getBlobAccess(containerName,
blobName);
if (access == BlobAccess.PUBLIC_READ) {
handleBlobMetadata(response, blobStore, path[1], path[2]);
} else {
throw new S3Exception(S3ErrorCode.ACCESS_DENIED);
}
}
break;
return;
case "POST":
if (path.length <= 2 || path[2].isEmpty()) {
handlePostBlob(request, response, blobStore, path[1]);