diff sat/plugins/plugin_comp_file_sharing.py @ 3359:000b6722bd35

plugin XEP-0329: added `FISCreateDir` method: This method is used to create a directory for component file sharing, and optionally set its configuration.
author Goffi <goffi@goffi.org>
date Thu, 17 Sep 2020 16:42:00 +0200
parents 12c427156cac
children e3bdfecaf1b0
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_file_sharing.py	Thu Sep 17 16:34:22 2020 +0200
+++ b/sat/plugins/plugin_comp_file_sharing.py	Thu Sep 17 16:42:00 2020 +0200
@@ -391,8 +391,6 @@
             client._file_sharing_base_url = f"https://{client.host}:{self.http_port}"
         else:
             client._file_sharing_base_url = public_base_url
-        client._file_sharing_allowed_hosts = self.host.memory.getConfig(
-            'component file_sharing', 'http_upload_allowed_hosts_list') or [client.host]
         path = client.file_tmp_dir = os.path.join(
             self.host.memory.getConfig("", "local_dir"),
             C.FILES_TMP_DIR,
@@ -596,6 +594,7 @@
     def _onHTTPUpload(self, client, request):
         # filename should be already cleaned, but it's better to double check
         assert '/' not in request.filename
+        # client._file_sharing_allowed_hosts is set in plugin XEP-0329
         if request.from_.host not in client._file_sharing_allowed_hosts:
             raise error.StanzaError("forbidden")