timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 74 forks source link

CSS is served as Content-Type:text/html; #122

Closed marcus-at-localhost closed 6 years ago

marcus-at-localhost commented 6 years ago

For some reason the css is served as Content-Type: text/html and thus there are no styles applied to the preview. Javascript is served fine though.

Request URL:http://127.0.0.1:51004/public/github.css
Request Method:GET
Status Code:200 OK
Remote Address:127.0.0.1:51004
Referrer Policy:no-referrer-when-downgrade

# Response Headers
HTTP/1.1 200 OK
Last-Modified: Mi, 13 Sep 2017 19:46:05 GMT
Content-Length: 16095
Accept-Ranges: bytes
Content-Type: text/html; charset=UTF-8
Date: Wed, 13 Sep 2017 20:35:54 GMT
Server: siebenmo

# Request Headers
GET /public/github.css HTTP/1.1
Host: 127.0.0.1:51004
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36
Accept: text/css,*/*;q=0.1
DNT: 1
Referer: http://127.0.0.1:51004/view/36
Accept-Encoding: gzip, deflate, br
Accept-Language: de,en-US;q=0.8,en;q=0.6

Any idea? I already uninstalled/installed the extension and it happens in all browsers.

marcus-at-localhost commented 6 years ago

Holy freak, I found the solution, thanks to this comment: https://github.com/pallets/flask/issues/1045#issuecomment-42202749

The python mimetypes module pulls the values from the registry on windows so somehow your registry has got a bit messed up.

I ended up in bottle.py trying to understand where the wrong content/mime type is coming from and it's my windows registry!