local python simple http erver sends wrong mime type in windows but not in linux for.svg -
I created a simple HTTP server in Python (I did not touch the do_GET function)
Linux In (Ubuntu) everything works well, but in windows when I want to open the .svg file in Firefox (hence) it asks me if I want to download or save it.
It has been determined that in the last question on this site, this is because the server sends the wrong mime type
The response header in Windows has the content type: 'App / octet-stream '
The content type in the response header in Linux is:' image / svg + xml '
The local server used is similar in both cases.
Do anyone know what I should do to fix this (in other words SVG send with the correct mime type)? I have tried to use meta tags in the svg file to specify the content that does not help you.
tnx
Edit:
How to read the documentation better is a extension_map attribute in the class (simpleHTTPServer.simpleRequestHandler) which is a dictionary that is a dictionary of mam extensions For the MAM extension, this is exactly what I want
MODS are free to remove this question if you want
Thank you for the reply to the Mikko, it correct me
You want mimetypes Add_type ().
Linux provides system-wide mimetypes configuration with up-to-date entries. Apparently there is no Windows.
Comments
Post a Comment