Not sure why, but mimeType is not always populated
This commit is contained in:
@@ -54,6 +54,13 @@
|
||||
}
|
||||
|
||||
NSString *mimeType = [transfer mimeType];
|
||||
// It's unusual, but if this is nil, try to guess the MIME type based on the filename
|
||||
if (!mimeType) {
|
||||
NSString *extension = [[localPath pathExtension] lowercaseString];
|
||||
|
||||
// XXX: REALLY hacky
|
||||
mimeType = [NSString stringWithFormat:@"image/%@", extension];
|
||||
}
|
||||
response = [[MBIMDataResponse alloc] initWithData:responseData contentType:mimeType];
|
||||
} while (0);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
- (NSDictionary *)httpHeaders
|
||||
{
|
||||
return @{
|
||||
@"Content-Type" : _contentType
|
||||
@"Content-Type" : _contentType ?: @"application/octet-stream"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user