##// END OF EJS Templates
cleanup weird 404
MinRK -
Show More
@@ -400,10 +400,9 b' class FileFindHandler(web.StaticFileHandler):'
400 return
400 return
401
401
402 if os.path.splitext(path)[1] == '.ipynb':
402 if os.path.splitext(path)[1] == '.ipynb':
403 raise HTTPError(404, 'HAHA')
403 name = os.path.basename(path)
404 name = os.path.splitext(os.path.split(path))[0]
405 self.set_header('Content-Type', 'application/json')
404 self.set_header('Content-Type', 'application/json')
406 self.set_header('Content-Disposition','attachment; filename="%s.ipynb"' % name)
405 self.set_header('Content-Disposition','attachment; filename="%s"' % name)
407
406
408 with open(abspath, "rb") as file:
407 with open(abspath, "rb") as file:
409 data = file.read()
408 data = file.read()
General Comments 0
You need to be logged in to leave comments. Login now