projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: fixup
[akkoma]
/
lib
/
pleroma
/
reverse_proxy.ex
diff --git
a/lib/pleroma/reverse_proxy.ex
b/lib/pleroma/reverse_proxy.ex
index 39ede8619a77c974432025151458e35dcedb1263..a3f177fec06d4ea8ab3da7e41d9a159663ca02ff 100644
(file)
--- a/
lib/pleroma/reverse_proxy.ex
+++ b/
lib/pleroma/reverse_proxy.ex
@@
-316,9
+316,9
@@
defmodule Pleroma.ReverseProxy do
{{"content-disposition", content_disposition_string}, _} =
List.keytake(headers, "content-disposition", 0)
{{"content-disposition", content_disposition_string}, _} =
List.keytake(headers, "content-disposition", 0)
- [name] =
+ [name
| _
] =
Regex.run(
Regex.run(
- ~r/filename=
\"(.*)\
"/u,
+ ~r/filename=
"((?:[^"\\]|\\.)*)
"/u,
content_disposition_string || "",
capture: :all_but_first
)
content_disposition_string || "",
capture: :all_but_first
)
@@
-328,7
+328,7
@@
defmodule Pleroma.ReverseProxy do
MatchError -> Keyword.get(opts, :attachment_name, "attachment")
end
MatchError -> Keyword.get(opts, :attachment_name, "attachment")
end
- disposition = "attachment; filename=
" <> name
+ disposition = "attachment; filename=
\"#{name}\""
List.keystore(headers, "content-disposition", 0, {"content-disposition", disposition})
else
List.keystore(headers, "content-disposition", 0, {"content-disposition", disposition})
else