Tom Andersen
Committed by Ben Copsey

Fixed bug in Object request for using subResource by adding ivar and a little code

... ... @@ -27,6 +27,8 @@
// Set this if having the correct mime type returned to you when you GET the data is important (eg it will be served by a web-server)
// Can be autodetected when PUTing a file from disk, will default to 'application/octet-stream' when PUTing data
NSString *mimeType;
NSString* subResource;
}
// Create a request, building an appropriate url
... ... @@ -63,5 +65,6 @@
@property (retain) NSString *sourceBucket;
@property (retain) NSString *sourceKey;
@property (retain) NSString *mimeType;
@property (retain) NSString *subResource;
@end
... ...
... ... @@ -32,6 +32,7 @@
{
NSString *path = [ASIS3Request stringByURLEncodingForS3Path:key];
ASIS3ObjectRequest *request = [[[self alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.s3.amazonaws.com%@?%@",bucket,path,subResource]]] autorelease];
request.subResource = subResource;
[request setBucket:bucket];
[request setKey:key];
return request;
... ... @@ -114,6 +115,9 @@
- (NSString *)canonicalizedResource
{
if ([self.subResource length] > 0)
return [NSString stringWithFormat:@"/%@%@?%@",[self bucket],[ASIS3Request stringByURLEncodingForS3Path:[self key]], self.subResource];
return [NSString stringWithFormat:@"/%@%@",[self bucket],[ASIS3Request stringByURLEncodingForS3Path:[self key]]];
}
... ... @@ -143,4 +147,6 @@
@synthesize sourceBucket;
@synthesize sourceKey;
@synthesize mimeType;
@synthesize subResource;
@end
... ...