Open Speuta opened 7 years ago
Found the solution, Can you add svg MIME type to NanoHTTPD.java file ?
I added "svg image/svg+xml "+
on line 1114, and it work fine.
Thank you !!
Any idea how to fix the same problem in Cocoa for iOs ?
I have the same issue on IOS too. Do you have any solutions?
Hi @devAxeon try this https://github.com/robbiehanson/CocoaHTTPServer/issues/106
@devAxeon To add SVG support on iOS add the following to HTTPFileResponse.m
- (NSDictionary *)httpHeaders {
//HTTPLogTrace();
if ([[filePath pathExtension] isEqualToString:@"svg"]) {
return [NSDictionary dictionaryWithObject:@"image/svg+xml" forKey:@"Content-Type"];
}
return [NSDictionary new];
}
I use img tags with svg link inside
<img src="relative/path/to/myImage.svg"/>
and the link is good(http://localhost:8080/path/to/myimage.svg),
but they are not displayed..Looking in the Network tab, the image respond with 200 Status code, and I don't know where this problem can come from...
I've tried a lot of CSP configs, but no one seems to work..