changeset 3301:9d1c0feba048

comp file sharing: file paths are now quoted on upload to allow unicode
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 14:56:45 +0200
parents b56e4c6b13fc
children 9d61ceeaa847
files sat/plugins/plugin_comp_file_sharing.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_file_sharing.py	Fri Jun 19 14:55:30 2020 +0200
+++ b/sat/plugins/plugin_comp_file_sharing.py	Fri Jun 19 14:56:45 2020 +0200
@@ -195,7 +195,11 @@
         # the 2 following headers are not standard, but useful in the context of file
         # sharing with HTTP Upload: first one allow uploaded to specify the path
         # and second one will disable public exposure of the file through HTTP
-        path = request.getHeader("Xmpp-File-Path") or "/uploads"
+        path = request.getHeader("Xmpp-File-Path")
+        if path:
+            path = unquote(path)
+        else:
+            path =  "/uploads"
         if request.getHeader("Xmpp-File-No-Http") is not None:
             public_id = None
         else: