Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Tom Andersen
2010-04-15 15:06:25 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
Ben Copsey
2010-04-16 08:51:50 +0100
Commit
b6c0f2959f85b3a66b416b838f22eb2d1971e961
b6c0f295
1 parent
3cbd8d6f
Fixed bug in Object request for using subResource by adding ivar and a little code
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
Classes/S3/ASIS3ObjectRequest.h
Classes/S3/ASIS3ObjectRequest.m
Classes/S3/ASIS3ObjectRequest.h
View file @
b6c0f29
...
...
@@ -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
...
...
Classes/S3/ASIS3ObjectRequest.m
View file @
b6c0f29
...
...
@@ -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
...
...
Please
register
or
login
to post a comment