kopia lustrzana https://github.com/gaul/s3proxy
Reduce exception handling scope
rodzic
e1c7b22b7d
commit
bae51b500a
|
@ -995,14 +995,10 @@ final class S3ProxyHandler extends AbstractHandler {
|
||||||
|
|
||||||
PutOptions options = new PutOptions()
|
PutOptions options = new PutOptions()
|
||||||
.multipart(forceMultiPartUpload);
|
.multipart(forceMultiPartUpload);
|
||||||
|
String eTag;
|
||||||
try {
|
try {
|
||||||
String eTag = blobStore.putBlob(containerName, builder.build(),
|
eTag = blobStore.putBlob(containerName, builder.build(),
|
||||||
options);
|
options);
|
||||||
// S3 quotes ETag while Swift does not
|
|
||||||
if (!eTag.startsWith("\"") && !eTag.endsWith("\"")) {
|
|
||||||
eTag = '"' + eTag + '"';
|
|
||||||
}
|
|
||||||
response.addHeader(HttpHeaders.ETAG, eTag);
|
|
||||||
} catch (ContainerNotFoundException cnfe) {
|
} catch (ContainerNotFoundException cnfe) {
|
||||||
sendSimpleErrorResponse(response, S3ErrorCode.NO_SUCH_BUCKET);
|
sendSimpleErrorResponse(response, S3ErrorCode.NO_SUCH_BUCKET);
|
||||||
return;
|
return;
|
||||||
|
@ -1034,6 +1030,12 @@ final class S3ProxyHandler extends AbstractHandler {
|
||||||
throw re;
|
throw re;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// S3 quotes ETag while Swift does not
|
||||||
|
if (!eTag.startsWith("\"") && !eTag.endsWith("\"")) {
|
||||||
|
eTag = '"' + eTag + '"';
|
||||||
|
}
|
||||||
|
response.addHeader(HttpHeaders.ETAG, eTag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue