mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-02 06:26:10 -04:00
Updates the unicode logic in share_mode code as well
This commit is contained in:
parent
1644e8691a
commit
c8e7e06a46
2 changed files with 293 additions and 190 deletions
|
@ -24,6 +24,8 @@ import tempfile
|
|||
import zipfile
|
||||
import mimetypes
|
||||
from flask import Response, request, render_template, make_response
|
||||
from unidecode import unidecode
|
||||
from werkzeug.urls import url_quote
|
||||
|
||||
from .send_base_mode import SendBaseModeWeb
|
||||
|
||||
|
@ -197,7 +199,11 @@ class ShareModeWeb(SendBaseModeWeb):
|
|||
if use_gzip:
|
||||
r.headers.set("Content-Encoding", "gzip")
|
||||
r.headers.set("Content-Length", self.filesize)
|
||||
r.headers.set("Content-Disposition", "attachment", filename=basename)
|
||||
filename_dict = {
|
||||
'filename': unidecode(basename),
|
||||
'filename*': "UTF-8''%s" % url_quote(basename)
|
||||
}
|
||||
r.headers.set("Content-Disposition", "inline", **filename_dict)
|
||||
r = self.web.add_security_headers(r)
|
||||
# guess content type
|
||||
(content_type, _) = mimetypes.guess_type(basename, strict=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue