Skip to content

Commit 0ee75b0

Browse files
author
erichmzhang
committed
# 5.4.1
- 修复了 XML 中以 / 结尾的 Object 会403的的问题。
1 parent 2ceb411 commit 0ee75b0

File tree

8 files changed

+53
-11
lines changed

8 files changed

+53
-11
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.1
2+
- 修复了 XML 中以 / 结尾的 Object 会403的的问题。
3+
14
# 5.4.0
25
- 修复了iOS8上面首次上传失败的问题
36
- 修复了反复多次调用分块复制接口会Crash的问题

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

66
s.homepage = "https://cloud.tencent.com/"
@@ -9,10 +9,10 @@ s.version = "5.4.0"
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.0'
12+
s.dependency "QCloudCore",'5.4.1'
1313

1414
s.subspec 'Transfer' do |sbt|
1515
sbt.source_files = 'QCloudCOSXML/Classes/Transfer/*','QCloudCOSXML/Classes/Base/*'
16-
sbt.dependency "QCloudCore",'5.4.0'
16+
sbt.dependency "QCloudCore",'5.4.1'
1717
end
1818
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 504000
9+
#define QCloudCOSXMLModuleVersionNumber 504001
1010

1111
//dependency
12-
#if QCloudCoreModuleVersionNumber != 504000
13-
#error "库QCloudCOSXML依赖QCloudCore最小版本号为5.4.0,当前引入的QCloudCore版本号过低,请及时升级后使用"
12+
#if QCloudCoreModuleVersionNumber != 504001
13+
#error "库QCloudCOSXML依赖QCloudCore最小版本号为5.4.1,当前引入的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.0";
2+
NSString * const QCloudCOSXMLModuleVersion = @"5.4.1";
33
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
44
@interface QCloudQCloudCOSXMLLoad : NSObject
55
@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.4.0"
11+
s.version = "5.4.1"
1212
s.summary = "QCloudCore--腾讯云iOS-SDK Foundation"
1313

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

QCloudCore/Classes/QCloudClientBase/Authentation/QCloudAuthentationV5Creator.m

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,45 @@ - (NSDictionary*)filteHeaders; {
4040
}
4141
@end
4242

43+
@implementation NSURL(QCloudExtension)
4344

45+
/**
46+
返回 COS 签名中用到的 path , 。如果没有path时,为 /
47+
48+
例如
49+
1. URL 为: http://test-123456.cos.ap-shanghai.myqcloud.com?delimiter=%2F&max-keys=1000&prefix=test%2F
50+
51+
path为 /
52+
53+
2. URL为: http://test-123456.cos.ap-shanghai.myqcloud.com/test
54+
path 为 test
55+
56+
3. URL为: http://test-123456.cos.ap-shanghai.myqcloud.com/test/
57+
path 为 test/
58+
59+
60+
@return COS签名中定义的 path
61+
*/
62+
63+
- (NSString*)qcloud_path {
64+
NSString* path = self.path;
65+
NSRange pathRange = [self.absoluteString rangeOfString:path];
66+
NSUInteger URLLength = self.absoluteString.length;
67+
if ( pathRange.location == NSNotFound ) {
68+
return path;
69+
}
70+
NSUInteger pathLocation = pathRange.location + pathRange.length;
71+
if (pathLocation >= URLLength) {
72+
return path;
73+
}
74+
if ( [self.absoluteString characterAtIndex:(pathLocation)] == '/' ) {
75+
path = [path stringByAppendingString:@"/"];
76+
return path;
77+
}
78+
return path;
79+
}
80+
81+
@end
4482

4583
@implementation QCloudAuthentationV5Creator
4684

@@ -92,7 +130,7 @@ - (QCloudSignature*) signatureForData:(NSMutableURLRequest *)urlrequest
92130
};
93131

94132
AppendFormatString(urlrequest.HTTPMethod.lowercaseString);
95-
NSString* path = urlrequest.URL.path;
133+
NSString* path = urlrequest.URL.qcloud_path;
96134
if (path.length == 0) {
97135
path = @"/";
98136
}
@@ -143,3 +181,4 @@ - (QCloudSignature*) signatureForData:(NSMutableURLRequest *)urlrequest
143181

144182

145183
@end
184+

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 504000
8+
#define QCloudCoreModuleVersionNumber 504001
99

1010
//dependency
1111

QCloudCore/Classes/QCloudCoreVersion.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "QCloudCoreVersion.h"
2-
NSString * const QCloudCoreModuleVersion = @"5.4.0";
2+
NSString * const QCloudCoreModuleVersion = @"5.4.1";
33
NSString * const QCloudCoreModuleName = @"QCloudCore";
44
@interface QCloudQCloudCoreLoad : NSObject
55
@end

0 commit comments

Comments
 (0)