From 1b7877dd0652ff12a6fdef5b51d392a578f575e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 4 Apr 2016 18:26:05 +0200 Subject: [PATCH] Use correct function to upload an attachment Fix #33 --- pymisp/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index 316d14c..7f835a8 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -629,7 +629,7 @@ class PyMISP(object): to_post = self.prepare_attribute(event_id, distribution, to_ids, category, info, analysis, threat_level_id) to_post['request']['files'] = [{'filename': filename, 'data': self._encode_file_to_upload(filepath)}] - return self._upload_sample(to_post) + return self._upload_attachment(to_post) def upload_attachmentlist(self, filepaths, event_id, distribution, to_ids, category, info, analysis, threat_level_id): @@ -641,7 +641,7 @@ class PyMISP(object): continue files.append({'filename': os.path.basename(path), 'data': self._encode_file_to_upload(path)}) to_post['request']['files'] = files - return self._upload_sample(to_post) + return self._upload_attachment(to_post) def _upload_attachment(self, to_post): session = self.__prepare_session('json')