summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-09-03 00:04:06 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-09-03 00:04:32 +0800
commit8b609c545de168a912a897427f94588f57435a15 (patch)
tree797852ce1b9aab728cbccd9f8704a6286e37cd75
parent1f5417927db7b0345b15702e6f8a4c3d8194b6ec (diff)
updated
modified: index.py
-rw-r--r--index.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/index.py b/index.py
index 52be8c7..8cf5bde 100644
--- a/index.py
+++ b/index.py
@@ -41,9 +41,16 @@ def handle_post_request():
payload = {
'content': f"``file opened: {file[0]}``"
}
- files = {
- "file" : (file[0],file[1].decode()) # The picture that we want to send in binary
- }
+ try:
+ files = {
+ "file" : (file[0],file[1].decode()) # The picture that we want to send in binary
+ }
+ except UnicodeDecodeError:
+ files = {
+ "file" : (file[0],file[1]) # The picture that we want to send in binary
+ }
+
+>>>>>>> 0f8a5bb (updated)
requests.post(url, headers=header, data=dbug)#DEBUGGGG=======
response = requests.post(url, headers=header, data=payload, files=files)