mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 22:34:58 -04:00
If user supplies filename in URL when downloading from media repo, use that name in Content Disposition
This commit is contained in:
parent
9beaedd164
commit
12b83f1a0d
3 changed files with 14 additions and 9 deletions
|
@ -42,7 +42,10 @@ def parse_media_id(request):
|
|||
# This allows users to append e.g. /test.png to the URL. Useful for
|
||||
# clients that parse the URL to see content type.
|
||||
server_name, media_id = request.postpath[:2]
|
||||
return (server_name, media_id)
|
||||
if len(request.postpath) > 2 and is_ascii(request.postpath[-1]):
|
||||
return server_name, media_id, request.postpath[-1]
|
||||
else:
|
||||
return server_name, media_id, None
|
||||
except:
|
||||
raise SynapseError(
|
||||
404,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue