fix(app): Added proper encoding to avoid app crashes while downloading files. Fixes: RCCE-37
This commit is contained in:
parent
6192f14c32
commit
e146c08808
1 changed files with 5 additions and 3 deletions
|
|
@ -808,9 +808,11 @@ class RepoFilesView(RepoAppView):
|
|||
safe_path = f_name.replace('"', '\\"')
|
||||
encoded_path = urllib.parse.quote(f_name)
|
||||
|
||||
return "attachment; " \
|
||||
"filename=\"{}\"; " \
|
||||
"filename*=UTF-8\'\'{}".format(safe_path, encoded_path)
|
||||
headers = "attachment; " \
|
||||
"filename=\"{}\"; " \
|
||||
"filename*=UTF-8\'\'{}".format(safe_path, encoded_path)
|
||||
|
||||
return headers.encode().decode('iso-8859-1', errors='replace')
|
||||
|
||||
@LoginRequired()
|
||||
@HasRepoPermissionAnyDecorator(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue