Skip to content

Commit

Permalink
Remove redundant encoding for binary mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wwakabobik committed Oct 10, 2023
1 parent 91a0a88 commit 5a1873c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions testrail_api_reporter/utils/reporter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def upload_image(filename, api_token):
"""
payload = {"type": "file", "action": "upload", "key": api_token}
with open(filename, "rb") as source_file:
files = {"source": source_file}
response = requests.post(
url="https://freeimage.host/api/1/upload", data=payload, timeout=5, verify=True, files=files
)
response = requests.post(
url="https://freeimage.host/api/1/upload", data=payload, timeout=5, verify=True,
files={"source": source_file}
)
return {
"image": response.json()["image"]["file"]["resource"]["chain"]["image"],
"thumb": response.json()["image"]["file"]["resource"]["chain"]["thumb"],
Expand Down

0 comments on commit 5a1873c

Please sign in to comment.