Skip to content

Commit 095ceb3

Browse files
author
erichmzhang
committed
#5.4.3
- 修复Copy接口中,source为中文时会导致403的问题
1 parent c39d602 commit 095ceb3

11 files changed

+75
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#5.4.3
2+
- 修复Copy接口中,source为中文时会导致403的问题
3+
14
# 5.4.2
25
- 修复了返回数组类型的属性,如果数组内容只有一个时候会解析失败的问题。
36

QCloudCOSXML.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "QCloudCOSXML"
3-
s.version = "5.4.2"
3+
s.version = "5.4.3"
44
s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件"
55

66
s.homepage = "https://cloud.tencent.com/"
@@ -9,10 +9,10 @@ s.version = "5.4.2"
99
s.source = { :git => "https://github.com/tencentyun/qcloud-sdk-ios.git", :tag => s.version.to_s }
1010
s.ios.deployment_target = '8.0'
1111
s.source_files = 'QCloudCOSXML/Classes/**/*'
12-
s.dependency "QCloudCore",'5.4.2'
12+
s.dependency "QCloudCore",'5.4.3'
1313

1414
s.subspec 'Transfer' do |sbt|
1515
sbt.source_files = 'QCloudCOSXML/Classes/Transfer/*','QCloudCOSXML/Classes/Base/*'
16-
sbt.dependency "QCloudCore",'5.4.2'
16+
sbt.dependency "QCloudCore",'5.4.3'
1717
end
1818
end

QCloudCOSXML/Classes/Manager/QCloudBucket.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ + (NSDictionary *)modelCustomPropertyMapper
3838
return @{
3939
@"name" :@"Name",
4040
@"location" :@"Location",
41-
@"createDate" :@"CreateDate",
41+
@"createDate" :@"CreationDate",
4242
};
4343
}
4444

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// QCloudListAllMyBucketsResult+CustomModelTransfer.h
3+
// FLEX
4+
//
5+
// Created by erichmzhang(张恒铭) on 03/04/2018.
6+
//
7+
8+
#import <QCloudCOSXML/QCloudCOSXML.h>
9+
10+
@interface QCloudListAllMyBucketsResult (CustomModelTransfer)
11+
12+
@end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// QCloudListAllMyBucketsResult+CustomModelTransfer.m
3+
// FLEX
4+
//
5+
// Created by erichmzhang(张恒铭) on 03/04/2018.
6+
//
7+
8+
#import "QCloudListAllMyBucketsResult+CustomModelTransfer.h"
9+
10+
@implementation QCloudListAllMyBucketsResult (CustomModelTransfer)
11+
- (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic {
12+
13+
if (!dic) {
14+
return dic;
15+
}
16+
NSMutableDictionary* transfromDic = [NSMutableDictionary dictionaryWithDictionary:dic];
17+
NSArray* transformArrayKeypaths = @[
18+
@"Buckets",
19+
];
20+
21+
for (NSString* keyPath in transformArrayKeypaths) {
22+
id object = [dic valueForKeyPath:keyPath];
23+
if (!object) {
24+
continue;
25+
}
26+
if ([object isKindOfClass:[NSNull class]]) {
27+
continue;
28+
}
29+
if (![object isKindOfClass:[NSArray class]]) {
30+
if ([object isKindOfClass:[NSDictionary class]]) {
31+
id value = [[object allValues] firstObject];
32+
if ([value isKindOfClass:[NSArray class]]) {
33+
[transfromDic setValue:value forKey:keyPath];
34+
} else {
35+
[transfromDic setValue:@[value] forKey:keyPath];
36+
}
37+
}
38+
// [transfromDic setValue:@[object] forKeyPath:keyPath];
39+
}
40+
}
41+
42+
return transfromDic;
43+
44+
}
45+
46+
@end

QCloudCOSXML/Classes/QCloudCOSXMLVersion.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
#ifndef QCloudCOSXMLModuleVersion_h
88
#define QCloudCOSXMLModuleVersion_h
9-
#define QCloudCOSXMLModuleVersionNumber 504002
9+
#define QCloudCOSXMLModuleVersionNumber 504003
1010

1111
//dependency
12-
#if QCloudCoreModuleVersionNumber != 504002
13-
#error "库QCloudCOSXML依赖QCloudCore最小版本号为5.4.2,当前引入的QCloudCore版本号过低,请及时升级后使用"
12+
#if QCloudCoreModuleVersionNumber != 504003
13+
#error "库QCloudCOSXML依赖QCloudCore最小版本号为5.4.3,当前引入的QCloudCore版本号过低,请及时升级后使用"
1414
#endif
1515

1616
//

QCloudCOSXML/Classes/QCloudCOSXMLVersion.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "QCloudCOSXMLVersion.h"
2-
NSString * const QCloudCOSXMLModuleVersion = @"5.4.2";
2+
NSString * const QCloudCOSXMLModuleVersion = @"5.4.3";
33
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
44
@interface QCloudQCloudCOSXMLLoad : NSObject
55
@end

QCloudCOSXML/Classes/Transfer/QCloudCOSXMLCopyObjectRequest.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#import "QCloudCompleteMultipartUploadRequest.h"
1515
#import "QCloudCompleteMultipartUploadInfo.h"
1616
#import "QCloudHeadObjectRequest.h"
17+
#import "QCloudURLHelper.h"
1718
static NSString* const kTempServiceKey = @"tempServiceKey";
1819
static NSString* const kContentLengthKey = @"Content-Length";
1920
static NSString* const kLastModifiedKey = @"Last-Modified";
@@ -90,7 +91,7 @@ - (void)simpleCopy {
9091
NSMutableString* objectCopySource = [NSMutableString string];
9192
NSString* serviceURL =[service.configuration.endpoint serverURLWithBucket:self.sourceBucket appID:self.sourceAPPID].absoluteString;
9293
[objectCopySource appendString:[serviceURL componentsSeparatedByString:@"://"][1]];
93-
[objectCopySource appendFormat:@"/%@",self.sourceObject];
94+
[objectCopySource appendFormat:@"/%@",QCloudPercentEscapedStringFromString(self.sourceObject)];
9495
request.objectCopySource = objectCopySource;
9596
QCloudLogDebug(@"Object copy source url %@", objectCopySource);
9697
[[QCloudCOSXMLService defaultCOSXML] PutObjectCopy:request];
@@ -145,7 +146,7 @@ - (void)uploadCopyParts {
145146
NSMutableString* objectCopySource = [NSMutableString string];
146147
NSString* serviceURL =[service.configuration.endpoint serverURLWithBucket:self.sourceBucket appID:self.sourceAPPID].absoluteString;
147148
[objectCopySource appendString:[serviceURL componentsSeparatedByString:@"://"][1]];
148-
[objectCopySource appendFormat:@"/%@",self.sourceObject];
149+
[objectCopySource appendFormat:@"/%@",QCloudPercentEscapedStringFromString(self.sourceObject)];
149150
request.source = objectCopySource;
150151
request.uploadID = self.uploadID;
151152
request.partNumber = i+1;

QCloudCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = "QCloudCore"
11-
s.version = "5.4.2"
11+
s.version = "5.4.3"
1212
s.summary = "QCloudCore--腾讯云iOS-SDK Foundation"
1313

1414
# This description is used to generate tags and improve search results.

QCloudCore/Classes/QCloudCoreVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#ifndef QCloudCoreModuleVersion_h
77
#define QCloudCoreModuleVersion_h
8-
#define QCloudCoreModuleVersionNumber 504002
8+
#define QCloudCoreModuleVersionNumber 504003
99

1010
//dependency
1111

0 commit comments

Comments
 (0)