Skip to content

Commit a8b58a3

Browse files
author
garenwang
committed
6.4.0提交
1 parent 605bc46 commit a8b58a3

File tree

19 files changed

+74
-22
lines changed

19 files changed

+74
-22
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
# 6.3.9
1+
# 6.4.0
2+
3+
1、修改getBucket接口漏洞
4+
5+
# 6.3.9
6+
27
1、高级上传接口支持callback。
38
2、优化上传contenttype参数。
49
3、修改WeakSelf为QCloudWeakSelf;
510
4、修复 其他已知问题。
611

12+
713
# 6.3.8
14+
815
修复断点下载问题
916

1017

1118
# 6.3.7
19+
1220
1.默认https协议。
1321
2、提供httpdns全局开关。
1422
3、修复6.3.5,6.3.6灯塔crash。

QCloudCOSXML.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pod::Spec.new do |s|
22
s.name = "QCloudCOSXML"
33

44

5-
s.version = "6.3.9"
5+
s.version = "6.4.0"
66

77

88
s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件"
@@ -20,22 +20,22 @@ s.version = "6.3.9"
2020
s.default_subspec = 'Default'
2121
s.subspec 'Default' do |default|
2222
default.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
23-
default.dependency "QCloudCore",'6.3.9'
23+
default.dependency "QCloudCore",'6.4.0'
2424
end
2525
s.subspec 'Slim' do |slim|
2626
slim.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
27-
slim.dependency "QCloudCore/WithoutMTA",'6.3.9'
27+
slim.dependency "QCloudCore/WithoutMTA",'6.4.0'
2828
end
2929
s.subspec 'Transfer' do |transfer|
3030
transfer.source_files = 'QCloudCOSXML/Classes/*','QCloudCOSXML/Classes/Transfer/**/*','QCloudCOSXML/Classes/Base/**/*'
31-
transfer.dependency "QCloudCore/WithoutMTA",'6.3.9'
31+
transfer.dependency "QCloudCore/WithoutMTA",'6.4.0'
3232

3333
end
3434

3535
s.subspec 'Widget' do |widget|
3636
widget.source_files = 'QCloudCOSXML/Classes/*','QCloudCOSXML/Classes/Transfer/**/*','QCloudCOSXML/Classes/Base/**/*'
3737
widget.exclude_files = 'QCloudCOSXML/Classes/Base/QCloudLogManager.h','QCloudCOSXML/Classes/Base/QCloudLogManager.m'
38-
widget.dependency "QCloudCore/WithoutMTA",'6.3.9'
38+
widget.dependency "QCloudCore/WithoutMTA",'6.4.0'
3939
end
4040

4141
end

QCloudCOSXML/Classes/Manager/request/QCloudGetBucketRequest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ - (instancetype)init {
4444
if (!self) {
4545
return nil;
4646
}
47+
self.maxKeys = 1000;
4748
return self;
4849
}
4950
- (void)configureReuqestSerializer:(QCloudRequestSerializer *)requestSerializer responseSerializer:(QCloudResponseSerializer *)responseSerializer {

QCloudCOSXML/Classes/Manager/request/QCloudListObjectVersionsRequest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ - (instancetype)init {
4444
if (!self) {
4545
return nil;
4646
}
47+
self.maxKeys = 1000;
4748
return self;
4849
}
4950
- (void)configureReuqestSerializer:(QCloudRequestSerializer *)requestSerializer responseSerializer:(QCloudResponseSerializer *)responseSerializer {

QCloudCOSXML/Classes/QCloudCOSXMLVersion.h

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

66
#ifndef QCloudCOSXMLModuleVersion_h
77
#define QCloudCOSXMLModuleVersion_h
8-
#define QCloudCOSXMLModuleVersionNumber 603009
8+
#define QCloudCOSXMLModuleVersionNumber 604000
99

1010
//dependency
1111

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 = @"6.3.9";
2+
NSString * const QCloudCOSXMLModuleVersion = @"6.4.0";
33
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
44
@interface QCloudQCloudCOSXMLLoad : NSObject
55
@end

QCloudCOSXML/Classes/Transfer/request/QCloudCOSXMLDownloadObjectRequest.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@
121121
使用分块及续传下载时,指定任务记录文件的路径
122122
*/
123123
@property (strong, nonatomic) NSString *resumableTaskFile;
124+
125+
/// 是否使用路径检查,true为开启,false为关闭,默认为true;。
126+
@property (assign, nonatomic) BOOL objectKeySimplifyCheck;
127+
124128
//针对本次下载行流量控制的限速值,必须为数字,单位默认为 bit/s。限速值设置范围为819200 - 838860800,即100KB/s - 100MB/s,如果超出该范围将返回400错误
125129
@property (nonatomic, assign) NSInteger trafficLimit;
126130
- (void)setCOSServerSideEncyption;

QCloudCOSXML/Classes/Transfer/request/QCloudCOSXMLDownloadObjectRequest.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ - (instancetype)init {
3434
if (!self) {
3535
return nil;
3636
}
37+
self.objectKeySimplifyCheck = YES;
3738
_customHeaders = [NSMutableDictionary dictionary];
3839
_requestCacheArray = [NSPointerArray weakObjectsPointerArray];
3940
return self;
@@ -128,6 +129,7 @@ - (void)fakeStart {
128129
- (void)startGetObject {
129130

130131
QCloudGetObjectRequest *request = [QCloudGetObjectRequest new];
132+
request.objectKeySimplifyCheck = self.objectKeySimplifyCheck;
131133
request.trafficLimit = self.trafficLimit;
132134
request.payload = self.payload;
133135
request.customHeaders = [self.customHeaders mutableCopy];

QCloudCOSXML/Classes/Transfer/request/QCloudGetObjectRequest.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ RFC 2616 中定义的指定文件下载范围,以字节(bytes)为单位
131131
对象名
132132
*/
133133
@property (strong, nonatomic) NSString *object;
134+
135+
/// 是否禁用路径检查,默认不禁用。
136+
@property (assign, nonatomic) BOOL objectKeySimplifyCheck;
137+
134138
/**
135139
存储桶名
136140
*/
@@ -142,7 +146,7 @@ RFC 2616 中定义的指定文件下载范围,以字节(bytes)为单位
142146
//针对本次下载行流量控制的限速值,必须为数字,单位默认为 bit/s。限速值设置范围为819200 - 838860800,即100KB/s - 100MB/s,如果超出该范围将返回400错误
143147
@property (nonatomic, assign) NSInteger trafficLimit;
144148

145-
- (void)setFinishBlock:(void (^)(id _Nonnull, NSError *_Nonnull))finishBlock;
149+
- (void)setFinishBlock:(void (^_Nullable)(id _Nullable result, NSError *_Nullable error))finishBlock;
146150

147151
@end
148152
NS_ASSUME_NONNULL_END

QCloudCOSXML/Classes/Transfer/request/QCloudGetObjectRequest.m

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ - (instancetype)init {
4444
if (!self) {
4545
return nil;
4646
}
47+
self.objectKeySimplifyCheck = YES;
4748
return self;
4849
}
4950
- (void)configureReuqestSerializer:(QCloudRequestSerializer *)requestSerializer responseSerializer:(QCloudResponseSerializer *)responseSerializer {
@@ -73,7 +74,16 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
7374
return NO;
7475
}
7576
}
76-
77+
78+
if (self.objectKeySimplifyCheck && [[self simplifyPath:self.object] isEqualToString:@"/"]) {
79+
if (error != NULL) {
80+
*error = [NSError
81+
qcloud_errorWithCode:QCloudNetworkErrorCodeParamterInvalid
82+
message:[NSString stringWithFormat:
83+
@"The Getobject Key is illegal"]];
84+
return NO;
85+
}
86+
}
7787

7888
if (!self.bucket || ([self.bucket isKindOfClass:NSString.class] && ((NSString *)self.bucket).length == 0)) {
7989
if (error != NULL) {
@@ -163,7 +173,7 @@ - (QCloudSignatureFields *)signatureFields {
163173
return fileds;
164174
}
165175

166-
- (void)setFinishBlock:(void (^)(id _Nonnull result, NSError *_Nonnull error))finishBlock {
176+
- (void)setFinishBlock:(void (^_Nullable)(id _Nullable result, NSError *_Nullable error))finishBlock {
167177

168178
if (finishBlock) {
169179
QCloudWeakSelf(self);
@@ -194,5 +204,21 @@ - (void)setFinishBlock:(void (^)(id _Nonnull result, NSError *_Nonnull error))fi
194204
return [array copy];
195205
}
196206

207+
- (NSString *)simplifyPath:(NSString *)path {
208+
NSArray *names = [path componentsSeparatedByString:@"/"];
209+
NSMutableArray *stack = [NSMutableArray array];
210+
for (NSString *name in names) {
211+
if ([name isEqualToString:@".."]) {
212+
if (stack.count > 0) {
213+
[stack removeLastObject];
214+
}
215+
} else if (name.length > 0 && ![name isEqualToString:@"."]) {
216+
[stack addObject:name];
217+
}
218+
}
219+
return [@"/" stringByAppendingString:[stack componentsJoinedByString:@"/"]];
220+
}
221+
222+
197223
@end
198224
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)