Revision 0be02d23
b/asi-http-request-with-pithos/Classes/Pithos/ASIPithosAccountRequest.m | ||
---|---|---|
120 | 120 |
|
121 | 121 |
- (NSDictionary *)groups { |
122 | 122 |
if (groups == nil) { |
123 |
groups = [self getHeadersDictionaryForPrefix:@"X-Account-Group-"]; |
|
123 |
groups = [NSMutableDictionary dictionary]; |
|
124 |
NSMutableDictionary *groupsHeaders = [self getHeadersDictionaryForPrefix:@"X-Account-Group-"]; |
|
125 |
for (NSString *groupName in groupsHeaders) { |
|
126 |
[groups setObject:[[groupsHeaders objectForKey:groupName] componentsSeparatedByString:@","] |
|
127 |
forKey:groupName]; |
|
128 |
} |
|
124 | 129 |
[groups retain]; |
125 | 130 |
} |
126 | 131 |
return groups; |
... | ... | |
248 | 253 |
ASIPithosAccountRequest *request = [self storageRequestWithMethod:@"POST" pithos:pithos queryString:queryString]; |
249 | 254 |
|
250 | 255 |
if (groups) { |
251 |
for (NSString *key in [groups keyEnumerator]) {
|
|
256 |
for (NSString *key in groups) {
|
|
252 | 257 |
[request addRequestHeader:[self encodeToPercentEscape:[NSString stringWithFormat:@"X-Account-Group-%@", key]] |
253 |
value:[self encodeToPercentEscape:[groups objectForKey:key]]];
|
|
258 |
value:[self encodeToPercentEscape:[[groups objectForKey:key] componentsJoinedByString:@","]]];
|
|
254 | 259 |
} |
255 | 260 |
} |
256 | 261 |
|
257 | 262 |
if (metadata) { |
258 |
for (NSString *key in [metadata keyEnumerator]) {
|
|
263 |
for (NSString *key in metadata) {
|
|
259 | 264 |
[request addRequestHeader:[self encodeToPercentEscape:[NSString stringWithFormat:@"X-Account-Meta-%@", key]] |
260 | 265 |
value:[self encodeToPercentEscape:[metadata objectForKey:key]]]; |
261 | 266 |
} |
b/asi-http-request-with-pithos/Classes/Pithos/ASIPithosContainerRequest.m | ||
---|---|---|
298 | 298 |
ASIPithosContainerRequest *request = [self storageRequestWithMethod:@"PUT" pithos:pithos containerName:containerName]; |
299 | 299 |
|
300 | 300 |
if (policy) { |
301 |
for (NSString *key in [policy keyEnumerator]) {
|
|
301 |
for (NSString *key in policy) {
|
|
302 | 302 |
[request addRequestHeader:[NSString stringWithFormat:@"X-Container-Policy-%@", key] value:[policy objectForKey:key]]; |
303 | 303 |
} |
304 | 304 |
} |
305 | 305 |
|
306 | 306 |
if (metadata) { |
307 |
for (NSString *key in [metadata keyEnumerator]) {
|
|
307 |
for (NSString *key in metadata) {
|
|
308 | 308 |
[request addRequestHeader:[self encodeToPercentEscape:[NSString stringWithFormat:@"X-Container-Meta-%@", key]] |
309 | 309 |
value:[self encodeToPercentEscape:[metadata objectForKey:key]]]; |
310 | 310 |
} |
... | ... | |
334 | 334 |
containerName:containerName |
335 | 335 |
queryString:queryString]; |
336 | 336 |
if (policy) { |
337 |
for (NSString *key in [policy keyEnumerator]) {
|
|
337 |
for (NSString *key in policy) {
|
|
338 | 338 |
[request addRequestHeader:[NSString stringWithFormat:@"X-Container-Policy-%@", key] value:[policy objectForKey:key]]; |
339 | 339 |
} |
340 | 340 |
} |
341 | 341 |
|
342 | 342 |
if (metadata) { |
343 |
for (NSString *key in [metadata keyEnumerator]) {
|
|
343 |
for (NSString *key in metadata) {
|
|
344 | 344 |
[request addRequestHeader:[self encodeToPercentEscape:[NSString stringWithFormat:@"X-Container-Meta-%@", key]] |
345 | 345 |
value:[self encodeToPercentEscape:[metadata objectForKey:key]]]; |
346 | 346 |
} |
b/asi-http-request-with-pithos/Classes/Pithos/ASIPithosObjectRequest.m | ||
---|---|---|
141 | 141 |
} |
142 | 142 |
|
143 | 143 |
if (newMetadata) { |
144 |
for (NSString *key in [newMetadata keyEnumerator]) {
|
|
144 |
for (NSString *key in newMetadata) {
|
|
145 | 145 |
[self addRequestHeader:[self encodeToPercentEscape:[NSString stringWithFormat:@"X-Object-Meta-%@", key]] |
146 | 146 |
value:[self encodeToPercentEscape:[newMetadata objectForKey:key]]]; |
147 | 147 |
} |
b/asi-http-request-with-pithos/Classes/Pithos/ASIPithosRequest.m | ||
---|---|---|
322 | 322 |
|
323 | 323 |
- (NSMutableDictionary *)getHeadersDictionaryForPrefix:(NSString *)prefix { |
324 | 324 |
NSMutableDictionary *headersDictionary = [NSMutableDictionary dictionary]; |
325 |
for (NSString *key in [[self responseHeaders] keyEnumerator]) {
|
|
325 |
for (NSString *key in [self responseHeaders]) {
|
|
326 | 326 |
NSRange prefixRange = [key rangeOfString:prefix]; |
327 | 327 |
if (prefixRange.location == 0) { |
328 | 328 |
[headersDictionary setObject:[self decodeFromPercentEscape:[[self responseHeaders] objectForKey:key]] |
Also available in: Unified diff