Skip to content

Commit 85dd42e

Browse files
committed
add 406 retry
1 parent 864dd02 commit 85dd42e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

QiniuSDK/Http/QNResponseInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ extern const int kQNNetworkError;
2020
@property (nonatomic, readonly, getter = isCancelled) BOOL canceled;
2121
@property (nonatomic, readonly, getter = isOK) BOOL ok;
2222
@property (nonatomic, readonly, getter = isConnectionBroken) BOOL broken;
23+
@property (nonatomic, readonly) BOOL couldRetry;
2324

2425
+ (instancetype)cancel;
2526

2627
- (instancetype)initWithError:(NSError *)error;
2728

2829
- (instancetype)initWithCancelled;
2930

30-
@property (nonatomic, readonly) BOOL couldRetry;
31-
3231
- (instancetype)init:(int)status
3332
withReqId:(NSString *)reqId
3433
withXLog:(NSString *)xlog

QiniuSDK/Http/QNResponseInfo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ - (BOOL)isConnectionBroken {
4949
}
5050

5151
- (BOOL)couldRetry {
52-
return (_statusCode >= 500 && _statusCode < 600 && _statusCode != 579) || _statusCode == kQNNetworkError || _statusCode == 996;
52+
return (_statusCode >= 500 && _statusCode < 600 && _statusCode != 579) || _statusCode == kQNNetworkError || _statusCode == 996 || _statusCode == 406;
5353
}
5454

5555
- (instancetype)init:(int)status

0 commit comments

Comments
 (0)