We struggled to find a solution for serving SVG image assets using CocoaHTTPServer. Eventually did this which worked well...
Basically we added this to the top of our view controller, although the monkey patch could be put somewhere more sensible :)
@interface HTTPFileResponse (Svg)
@end
@implementation HTTPFileResponse (Svg)
- (NSDictionary *)httpHeaders {
//HTTPLogTrace();
if ([[filePath pathExtension] isEqualToString:@"svg"]) {
return [NSDictionary dictionaryWithObject:@"image/svg+xml" forKey:@"Content-Type"];
}
return [NSDictionary new];
}
@end
After u create the category
insert
#import "HTTPFileResponse+Svg.h"
below
#import "HTTPServer.h"