# HG changeset patch # User Nicholas Jillings # Date 1509470063 0 # Node ID b3230c0da598644140b9d7a6440716205f8e1a1b # Parent a504a17dcf9f362d7bdc905ff09db40577a8d9e2 Possible fix for #196 diff -r a504a17dcf9f -r b3230c0da598 python/pythonServer.py --- a/python/pythonServer.py Tue Oct 31 16:44:53 2017 +0000 +++ b/python/pythonServer.py Tue Oct 31 17:14:23 2017 +0000 @@ -69,16 +69,19 @@ st = s.path.rsplit(',') lenSt = len(st) fmt = st[lenSt-1].rsplit('.') + fmt = fmt[len(fmt)-1] + print(st) + print(fmt) fpath = "../"+urllib2.unquote(s.path) size = os.path.getsize(fpath) - fileDump = open(fpath) + fileDump = open(fpath, mode='rb') s.send_response(200) - if (fmt[1] == 'html'): + if (fmt == 'html'): s.send_header("Content-type", 'text/html') - elif (fmt[1] == 'css'): + elif (fmt == 'css'): s.send_header("Content-type", 'text/css') - elif (fmt[1] == 'js'): + elif (fmt == 'js'): s.send_header("Content-type", 'application/javascript') else: s.send_header("Content-type", 'application/octet-stream')