Page 1 of 1

Adding mimetype to plugin webserver

Posted: Sun Dec 16, 2012 10:46 pm
by EventGhost4ever
If you want to add a mimetype to the plugin webserver, you must only add

Code: Select all

 extensions_map['.fileExtension'] = 'mimeType'  
to the "class MyHTTPRequestHandler(SimpleHTTPRequestHandler)" .

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'
I think it would be great, if someone could add my svg extension to the next official EventGhost build.