cleanup weird 404

This commit is contained in:
MinRK 2013-10-08 17:21:11 -07:00
parent fc4fb92580
commit 821514bd72

View File

@ -400,10 +400,9 @@ class FileFindHandler(web.StaticFileHandler):
return
if os.path.splitext(path)[1] == '.ipynb':
raise HTTPError(404, 'HAHA')
name = os.path.splitext(os.path.split(path))[0]
name = os.path.basename(path)
self.set_header('Content-Type', 'application/json')
self.set_header('Content-Disposition','attachment; filename="%s.ipynb"' % name)
self.set_header('Content-Disposition','attachment; filename="%s"' % name)
with open(abspath, "rb") as file:
data = file.read()