Skip to content

Commit

Permalink
xx
Browse files Browse the repository at this point in the history
  • Loading branch information
lintianzhi committed Jul 23, 2014
1 parent 7a4944b commit 5b565ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions QiniuSDK/QiniuHttpClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ - (AFHTTPRequestOperation *)uploadFileData:(NSData *)data
if (key && ![key isEqualToString:kQiniuUndefinedKey]) {
parameters[@"key"] = key;
}
if (!key) {
key = kQiniuUndefinedKey;
}

parameters[@"token"] = token;

Expand Down
10 changes: 10 additions & 0 deletions QiniuSDKTests/QiniuSDKTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ - (void) testUploadData
XCTAssertEqual(_succeed, YES, "UploadData failed, error: %@", _error);
}

- (void) testUploadDataWithoutKey
{
QiniuSimpleUploader *uploader = [QiniuSimpleUploader uploaderWithToken:_token];
uploader.delegate = self;
NSData *data = [NSData dataWithContentsOfFile:_filePath];
[uploader uploadFileData:data key:nil extra:nil];
[self waitFinish];
XCTAssertEqual(_succeed, YES, "UploadData failed, error: %@", _error);
}

- (void) testSimpleUpload
{
QiniuSimpleUploader *uploader = [QiniuSimpleUploader uploaderWithToken:_token];
Expand Down

0 comments on commit 5b565ac

Please sign in to comment.