Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't url escape filenames on download #2761

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notebook/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class AuthenticatedFileHandler(IPythonHandler, web.StaticFileHandler):
def get(self, path):
if os.path.splitext(path)[1] == '.ipynb' or self.get_argument("download", False):
name = path.rsplit('/', 1)[-1]
self.set_header('Content-Disposition','attachment; filename="%s"' % escape.url_escape(name))
self.set_header('Content-Disposition','attachment; filename="%s"' % name)

return web.StaticFileHandler.get(self, path)

Expand Down
2 changes: 1 addition & 1 deletion notebook/files/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get(self, path, include_body=True):
model = cm.get(path, type='file', content=include_body)

if self.get_argument("download", False):
self.set_header('Content-Disposition','attachment; filename="%s"' % escape.url_escape(name))
self.set_header('Content-Disposition','attachment; filename="%s"' % name)

# get mimetype from filename
if name.endswith('.ipynb'):
Expand Down
4 changes: 2 additions & 2 deletions notebook/nbconvert/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def respond_zip(handler, name, output, resources):
# Headers
zip_filename = os.path.splitext(name)[0] + '.zip'
handler.set_header('Content-Disposition',
'attachment; filename="%s"' % escape.url_escape(zip_filename))
'attachment; filename="%s"' % zip_filename)
handler.set_header('Content-Type', 'application/zip')

# Prepare the zip file
Expand Down Expand Up @@ -115,7 +115,7 @@ def get(self, format, path):
if self.get_argument('download', 'false').lower() == 'true':
filename = os.path.splitext(name)[0] + resources['output_extension']
self.set_header('Content-Disposition',
'attachment; filename="%s"' % escape.url_escape(filename))
'attachment; filename="%s"' % filename)

# MIME type
if exporter.output_mimetype:
Expand Down