Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Adding mimetype to plugin webserver

Questions and comments specific to a particular plugin should go here.
Post Reply
EventGhost4ever
Posts: 11
Joined: Fri Oct 28, 2011 6:37 pm

Adding mimetype to plugin webserver

Post 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.
Post Reply