kopia lustrzana https://github.com/gaul/s3proxy
decode before splitting
rodzic
009a71d06c
commit
c1b8234596
|
@ -986,13 +986,14 @@ final class S3ProxyHandler extends AbstractHandler {
|
||||||
String destContainerName, String destBlobName)
|
String destContainerName, String destBlobName)
|
||||||
throws IOException, S3Exception {
|
throws IOException, S3Exception {
|
||||||
String copySourceHeader = request.getHeader("x-amz-copy-source");
|
String copySourceHeader = request.getHeader("x-amz-copy-source");
|
||||||
|
copySourceHeader = URLDecoder.decode(copySourceHeader, "UTF-8");
|
||||||
if (copySourceHeader.startsWith("/")) {
|
if (copySourceHeader.startsWith("/")) {
|
||||||
// Some clients like boto do not include the leading slash
|
// Some clients like boto do not include the leading slash
|
||||||
copySourceHeader = copySourceHeader.substring(1);
|
copySourceHeader = copySourceHeader.substring(1);
|
||||||
}
|
}
|
||||||
String[] path = copySourceHeader.split("/", 2);
|
String[] path = copySourceHeader.split("/", 2);
|
||||||
for (int i = 0; i < path.length; i++) {
|
if (path.length != 2) {
|
||||||
path[i] = URLDecoder.decode(path[i], "UTF-8");
|
throw new S3Exception(S3ErrorCode.INVALID_REQUEST);
|
||||||
}
|
}
|
||||||
String sourceContainerName = path[0];
|
String sourceContainerName = path[0];
|
||||||
String sourceBlobName = path[1];
|
String sourceBlobName = path[1];
|
||||||
|
|
Ładowanie…
Reference in New Issue