Permalink
Browse files

Merge pull request #2 from veritech/requestfix

Fixing two issues
  • Loading branch information...
2 parents 414de06 + 43b72eb commit 2f96fffbc4e3ef52346868b12b9e390ac36a6174 Mattt Thompson committed May 13, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 AFAmazonS3Client.m
View
@@ -73,8 +73,8 @@ - (id)initWithAccessKeyID:(NSString *)accessKey
}
- (NSURL *)baseURL {
- if (!_s3_baseURL && self.bucket) {
- return [NSString stringWithFormat:kAFAmazonS3BucketBaseURLFormatString, self.bucket];
+ if (_s3_baseURL && self.bucket) {
+ return [NSURL URLWithString:[NSString stringWithFormat:kAFAmazonS3BucketBaseURLFormatString, self.bucket]];
}
return _s3_baseURL;
@@ -236,7 +236,7 @@ - (void)setObjectWithMethod:(NSString *)method
NSData *data = [NSURLConnection sendSynchronousRequest:fileRequest returningResponse:&response error:&error];
if (data && response) {
- NSMutableURLRequest *request = [self multipartFormRequestWithMethod:path path:@"/" parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
+ NSMutableURLRequest *request = [self multipartFormRequestWithMethod:method path:path parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileData:data name:@"file" fileName:[path lastPathComponent] mimeType:[response MIMEType]];
}];

0 comments on commit 2f96fff

Please sign in to comment.