Skip to content

Commit

Permalink
Merge pull request #192 from pkgw/fix-mimetypes
Browse files Browse the repository at this point in the history
Fix pywwt on `notebook >=5.7.6`
  • Loading branch information
pkgw committed Apr 9, 2019
2 parents bea8b0c + d1b9f42 commit 9e39419
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pywwt/jupyter_server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import json
import mimetypes
from hashlib import md5
from tornado import web
from notebook.utils import url_path_join
Expand Down Expand Up @@ -33,6 +34,9 @@ def get(self, filename):
else:
raise web.HTTPError(404)

# Do our best to set an appropriate Content-Type.
self.set_header('Content-Type', mimetypes.guess_type(filename)[0])

with open(path, 'rb') as f:
content = f.read()

Expand Down

0 comments on commit 9e39419

Please sign in to comment.