##// END OF EJS Templates
fix(app): Added proper encoding to avoid app crashes while downloading files. Fixes: RCCE-37
ilin.s -
r5269:bd1533d7 default
parent child Browse files
Show More
@@ -808,9 +808,11 b' class RepoFilesView(RepoAppView):'
808 safe_path = f_name.replace('"', '\\"')
808 safe_path = f_name.replace('"', '\\"')
809 encoded_path = urllib.parse.quote(f_name)
809 encoded_path = urllib.parse.quote(f_name)
810
810
811 return "attachment; " \
811 headers = "attachment; " \
812 "filename=\"{}\"; " \
812 "filename=\"{}\"; " \
813 "filename*=UTF-8\'\'{}".format(safe_path, encoded_path)
813 "filename*=UTF-8\'\'{}".format(safe_path, encoded_path)
814
815 return headers.encode().decode('iso-8859-1', errors='replace')
814
816
815 @LoginRequired()
817 @LoginRequired()
816 @HasRepoPermissionAnyDecorator(
818 @HasRepoPermissionAnyDecorator(
General Comments 0
You need to be logged in to leave comments. Login now