@@ -67,18 +67,18 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
6767 if (!self.object || ([self .object isKindOfClass: NSString .class] && ((NSString *)self.object ).length == 0 )) {
6868 if (error != NULL ) {
6969 *error = [NSError
70- qcloud_errorWithCode: QCloudNetworkErrorCodeParamterInvalid
71- message: [NSString stringWithFormat:
72- @" InvalidArgument:paramter[object] is invalid (nil), it must have some value. please check it" ]];
70+ qcloud_errorWithCode: QCloudNetworkErrorCodeParamterInvalid
71+ message: [NSString stringWithFormat:
72+ @" InvalidArgument:paramter[object] is invalid (nil), it must have some value. please check it" ]];
7373 return NO ;
7474 }
7575 }
7676 if (!self.bucket || ([self .bucket isKindOfClass: NSString .class] && ((NSString *)self.bucket ).length == 0 )) {
7777 if (error != NULL ) {
7878 *error = [NSError
79- qcloud_errorWithCode: QCloudNetworkErrorCodeParamterInvalid
80- message: [NSString stringWithFormat:
81- @" InvalidArgument:paramter[bucket] is invalid (nil), it must have some value. please check it" ]];
79+ qcloud_errorWithCode: QCloudNetworkErrorCodeParamterInvalid
80+ message: [NSString stringWithFormat:
81+ @" InvalidArgument:paramter[bucket] is invalid (nil), it must have some value. please check it" ]];
8282 return NO ;
8383 }
8484 }
@@ -125,7 +125,10 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
125125 if (self.trafficLimit ) {
126126 [self .requestData setValue: @(self .trafficLimit).stringValue forHTTPHeaderField: @" x-cos-traffic-limit" ];
127127 }
128-
128+
129+ if (![self .customHeaders isKindOfClass: NSMutableDictionary .class]){
130+ self.customHeaders = self.customHeaders .mutableCopy ;
131+ }
129132 [self .customHeaders setObject: @" no-cache" forKey: @" Cache-Control" ];
130133
131134 NSURL *__serverURL = [self .runOnService.configuration.endpoint serverURLWithBucket: self .bucket
0 commit comments