kopia lustrzana https://github.com/gaul/s3proxy
Allow anonymous HEAD object on public-read objects
rodzic
024c7a3fe9
commit
118b656f8e
|
@ -618,9 +618,18 @@ final class S3ProxyHandler extends AbstractHandler {
|
||||||
if (!blobStore.containerExists(containerName)) {
|
if (!blobStore.containerExists(containerName)) {
|
||||||
throw new S3Exception(S3ErrorCode.NO_SUCH_BUCKET);
|
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":
|
case "POST":
|
||||||
if (path.length <= 2 || path[2].isEmpty()) {
|
if (path.length <= 2 || path[2].isEmpty()) {
|
||||||
handlePostBlob(request, response, blobStore, path[1]);
|
handlePostBlob(request, response, blobStore, path[1]);
|
||||||
|
|
Ładowanie…
Reference in New Issue