mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
(fix) handle URI in vCard photos (fixes #2683)
This commit is contained in:
@@ -40,25 +40,34 @@
|
||||
- (id) GETAction: (WOContext *) localContext
|
||||
{
|
||||
NGVCardPhoto *photo;
|
||||
NSData *data;
|
||||
NSString *uri;
|
||||
NSData *data;
|
||||
id response;
|
||||
|
||||
photo = [self photo];
|
||||
data = nil;
|
||||
uri = nil;
|
||||
|
||||
if ([photo isInline])
|
||||
data = [photo decodedContent];
|
||||
else
|
||||
data = [[photo flattenedValuesForKey: @""]
|
||||
dataUsingEncoding: NSISOLatin1StringEncoding];
|
||||
else if ([[photo value: 0 ofAttribute: @"value"] isEqualToString: @"uri"])
|
||||
uri = [photo flattenedValuesForKey: @""];
|
||||
|
||||
if (data)
|
||||
{
|
||||
response = [localContext response];
|
||||
|
||||
[response setHeader: [self davContentType] forKey: @"content-type"];
|
||||
[response setHeader: [NSString stringWithFormat:@" %d",
|
||||
(int)[data length]]
|
||||
forKey: @"content-length"];
|
||||
[response setContent: data];
|
||||
}
|
||||
else if (uri)
|
||||
{
|
||||
response = [localContext response];
|
||||
[response setStatus: 302];
|
||||
[response setHeader: uri forKey: @"location"];
|
||||
}
|
||||
else
|
||||
response = nil;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user