mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-14 13:45:29 -04:00
Port rest/ to Python 3 (#3823)
This commit is contained in:
parent
8fd93b5eea
commit
02aa41809b
18 changed files with 113 additions and 100 deletions
|
@ -56,7 +56,7 @@ class ContentRepoResource(resource.Resource):
|
|||
# servers.
|
||||
|
||||
# TODO: A little crude here, we could do this better.
|
||||
filename = request.path.split('/')[-1]
|
||||
filename = request.path.decode('ascii').split('/')[-1]
|
||||
# be paranoid
|
||||
filename = re.sub("[^0-9A-z.-_]", "", filename)
|
||||
|
||||
|
@ -78,7 +78,7 @@ class ContentRepoResource(resource.Resource):
|
|||
# select private. don't bother setting Expires as all our matrix
|
||||
# clients are smart enough to be happy with Cache-Control (right?)
|
||||
request.setHeader(
|
||||
"Cache-Control", "public,max-age=86400,s-maxage=86400"
|
||||
b"Cache-Control", b"public,max-age=86400,s-maxage=86400"
|
||||
)
|
||||
|
||||
d = FileSender().beginFileTransfer(f, request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue