Skip to content

Commit a521560

Browse files
author
karisli
committed
# 5.5.5
- bug修复
1 parent dde1b5f commit a521560

15 files changed

+74
-24
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 5.5.5
2+
- bug修复
3+
14
# 5.5.4
25
- 支持自定义Request的Region的时候支持校验
36
- ACL设置增加Default有效值

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.5.4"
3+
s.version = "5.5.5"
44
s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件"
55

66
s.homepage = "https://cloud.tencent.com/"
@@ -9,12 +9,12 @@ s.version = "5.5.4"
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.5.4'
12+
s.dependency "QCloudCore",'5.5.5'
1313
s.static_framework = true
1414

1515
s.subspec 'Transfer' do |sbt|
1616
sbt.source_files = 'QCloudCOSXML/Classes/Transfer/**/*','QCloudCOSXML/Classes/Base/*'
17-
sbt.dependency "QCloudCore",'5.5.4'
17+
sbt.dependency "QCloudCore",'5.5.5'
1818
# sbt.static_framework=true
1919
end
2020
end

QCloudCOSXML/Classes/Base/QCloudCOSXMLEndPoint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
服务地域名称,可用的服务地域名称请查看官网https://www.qcloud.com/document/product/436/6224中提供的地域,这里填入官网里提供的地域简称,例如ap-beijing-1等。
1616
*/
1717
@property (nonatomic, copy) QCloudRegion regionName;
18-
18+
@property (nonatomic,assign)BOOL isPrefixURL;
1919
/**
2020
服务的基础名称, 默认值为: myqcloud.com
2121
*/

QCloudCOSXML/Classes/Base/QCloudCOSXMLEndPoint.m

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ - (instancetype) init
1616
if (!self) {
1717
return self;
1818
}
19+
_isPrefixURL = YES;
1920
_serviceName = @"myqcloud.com";
2021
return self;
2122
}
@@ -53,33 +54,59 @@ -(NSURL *)serverURLWithBucket:(NSString *)bucket appID:(NSString *)appID regionN
5354
return nil;
5455
}
5556

56-
NSString* formattedBucketName = [self formattedBucket:bucket withAPPID:appID];
57+
NSString* formattedBucketName = [self formattedBucket:bucket withAPPID:appID]; ;
5758
NSString *regionNametmp = nil;
5859
if (regionName) {
5960
regionNametmp = regionName;
6061
}else{
6162
regionNametmp = self.regionName;
6263
}
63-
NSURL* serverURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@-%@.cos.%@.%@",scheme,formattedBucketName,appID,regionNametmp,self.serviceName]];
64+
NSString *tmpBucket = formattedBucketName;
65+
if (appID) {
66+
tmpBucket = [NSString stringWithFormat:@"%@-%@",formattedBucketName,appID];
67+
}
68+
NSURL *serverURL;
69+
70+
if (_isPrefixURL) {
71+
if (regionNametmp) {
72+
serverURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@.cos.%@.%@",scheme,tmpBucket,regionNametmp,self.serviceName]];
73+
}else{
74+
serverURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@.cos.%@",scheme,tmpBucket,self.serviceName]];
75+
}
76+
}else{
77+
if (regionNametmp) {
78+
serverURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://cos.%@.%@/%@",scheme,regionNametmp,self.serviceName,tmpBucket]];
79+
}else{
80+
serverURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://cos.%@/%@",scheme,self.serviceName,tmpBucket]];
81+
}
82+
}
83+
6484
return serverURL;
6585
}
66-
86+
-(void)setIsPrefixURL:(BOOL)isPrefixURL{
87+
_isPrefixURL = isPrefixURL;
88+
}
6789
- (void)setRegionName:(QCloudRegion)regionName {
6890
//Region 仅允许由 a-z, A-Z, 0-9, 英文句号. 和 - 构成。
69-
NSParameterAssert(regionName);
70-
static NSString *regularExpression = @"[a-zA-Z0-9.-]*";
71-
BOOL isLegal = [regionName matchesRegularExpression:regularExpression];
72-
NSAssert(isLegal, @"Region name contains illegal character! It can only contains a-z, A-Z, 0-9, '.' and '-' ");
73-
if (!isLegal) {
74-
QCloudLogDebug(@"Region %@ contains illeagal character, setter returns immediately", regionName);
75-
return ;
91+
if ([self.serviceName isEqualToString:@"myqcloud.com"]) {
92+
NSParameterAssert(regionName);
93+
static NSString *regularExpression = @"[a-zA-Z0-9.-]*";
94+
BOOL isLegal = [regionName matchesRegularExpression:regularExpression];
95+
NSAssert(isLegal, @"Region name contains illegal character! It can only contains a-z, A-Z, 0-9, '.' and '-' ");
96+
if (!isLegal) {
97+
QCloudLogDebug(@"Region %@ contains illeagal character, setter returns immediately", regionName);
98+
return ;
99+
}
76100
}
101+
102+
77103
_regionName = regionName;
78104
}
79105
- (id)copyWithZone:(NSZone *)zone {
80106
QCloudCOSXMLEndPoint* endpoint = [super copyWithZone:nil];
81107
endpoint.regionName = self.regionName;
82108
endpoint.serviceName = self.serviceName;
109+
endpoint.isPrefixURL = self.isPrefixURL;
83110
return endpoint;
84111
}
85112
@end

QCloudCOSXML/Classes/Manager/request/QCloudGetBucketRequest.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,10 @@ - (QCloudSignatureFields*) signatureFields
106106
return fileds;
107107
}
108108

109+
110+
-(QCloudSignature *)signature{
111+
QCloudSignature *sig = [QCloudSignature new];
112+
return sig;
113+
}
109114
@end
110115
NS_ASSUME_NONNULL_END

QCloudCOSXML/Classes/Manager/request/QCloudGetServiceRequest+Custom.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ - (BOOL) customBuildRequestData:(NSError *__autoreleasing *)error
3434
}
3535
self.requestData.serverURL = @"http://service.cos.myqcloud.com";
3636
if (![self.runOnService.configuration.endpoint.serviceName isEqualToString:@"myqcloud.com"]) {
37-
self.requestData.serverURL = [NSString stringWithFormat:@"http://service.cos.%@.%@",self.runOnService.configuration.endpoint.regionName,self.runOnService.configuration.endpoint.serviceName];
37+
if (self.runOnService.configuration.endpoint.regionName) {
38+
self.requestData.serverURL = [NSString stringWithFormat:@"http://service.cos.%@.%@",self.runOnService.configuration.endpoint.regionName,self.runOnService.configuration.endpoint.serviceName];
39+
}else{
40+
self.requestData.serverURL = [NSString stringWithFormat:@"http://service.cos.%@",self.runOnService.configuration.endpoint.serviceName];
41+
}
42+
3843
}
3944

4045
return YES;

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 505004
9+
#define QCloudCOSXMLModuleVersionNumber 505005
1010

1111
//dependency
12-
#if QCloudCoreModuleVersionNumber != 505004
13-
#error "库QCloudCOSXML依赖QCloudCore最小版本号为5.5.4,当前引入的QCloudCore版本号过低,请及时升级后使用"
12+
#if QCloudCoreModuleVersionNumber != 505005
13+
#error "库QCloudCOSXML依赖QCloudCore最小版本号为5.5.5,当前引入的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.5.4";
2+
NSString * const QCloudCOSXMLModuleVersion = @"5.5.5";
33
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
44
@interface QCloudQCloudCOSXMLLoad : NSObject
55
@end

QCloudCOSXML/Classes/Transfer/request/QCloudPutObjectRequest+Custom.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,6 @@ -(void)setCOSServerSideEncyptionWithKMSCustomKey:(NSString *)customerKey jsonStr
9191
self.customHeaders[@"x-cos-server-side-encryption-context"] = [data base64EncodedStringWithOptions:0];
9292
}
9393
}
94+
95+
9496
@end

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.5.4"
11+
s.version = "5.5.5"
1212
s.summary = "QCloudCore--腾讯云iOS-SDK Foundation"
1313

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

0 commit comments

Comments
 (0)