Skip to content

Commit f88d100

Browse files
authored
Merge pull request #29 from liuyongqing/master
fix copy action wrong url
2 parents e0bf35d + ad465c2 commit f88d100

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
dnl Process this file with autoconf to produce a configure script.
1919

2020
AC_PREREQ(2.59)
21-
AC_INIT(cosfs, 1.0.11)
21+
AC_INIT(cosfs, 1.0.12)
2222
AC_CONFIG_HEADER([config.h])
2323

2424
AC_CANONICAL_SYSTEM

src/curl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3292,7 +3292,7 @@ int S3fsCurl::MultipartRenameRequest(const char* from, const char* to, headers_t
32923292
MakeUrlResource(get_realpath(from).c_str(), srcresource, srcurl);
32933293

32943294
meta["Content-Type"] = S3fsCurl::LookupMimeType(string(to));
3295-
meta["x-cos-copy-source"] = srcresource;
3295+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + get_realpath(from));
32963296

32973297
if(0 != (result = PreMultipartPostRequest(to, meta, upload_id, true))){
32983298
return result;

src/s3fs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ static int rename_object(const char* from, const char* to)
11891189
}
11901190
s3_realpath = get_realpath(from);
11911191

1192-
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + s3_realpath);
1192+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + s3_realpath);
11931193
meta["Content-Type"] = S3fsCurl::LookupMimeType(string(to));
11941194
meta["x-cos-metadata-directive"] = "REPLACE";
11951195

@@ -3112,7 +3112,7 @@ static int s3fs_setxattr(const char* path, const char* name, const char* value,
31123112
}
31133113

31143114
// set xattr all object
3115-
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + get_realpath(strpath.c_str()));
3115+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + get_realpath(strpath.c_str()));
31163116
meta["x-cos-metadata-directive"] = "REPLACE";
31173117

31183118
if(0 != put_headers(strpath.c_str(), meta, true)){
@@ -3375,7 +3375,7 @@ static int s3fs_removexattr(const char* path, const char* name)
33753375
}
33763376

33773377
// set xattr all object
3378-
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + get_realpath(strpath.c_str()));
3378+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + get_realpath(strpath.c_str()));
33793379
meta["x-cos-metadata-directive"] = "REPLACE";
33803380

33813381
if(0 != put_headers(strpath.c_str(), meta, true)){

0 commit comments

Comments
 (0)