Adding mimetype to plugin webserver
Posted: Sun Dec 16, 2012 10:46 pm
If you want to add a mimetype to the plugin webserver, you must only add to the "class MyHTTPRequestHandler(SimpleHTTPRequestHandler)" .
For example I have added support for svg images.
I think it would be great, if someone could add my svg extension to the next official EventGhost build.
Code: Select all
extensions_map['.fileExtension'] = 'mimeType' For example I have added support for svg images.
Code: Select all
class MyHTTPRequestHandler(SimpleHTTPRequestHandler):
extensions_map = SimpleHTTPRequestHandler.extensions_map.copy()
extensions_map['.ico'] = 'image/x-icon'
extensions_map['.manifest'] = 'text/cache-manifest'
extensions_map['.svg'] = 'image/svg+xml'