Skip to content

Commit a5d9740

Browse files
authored
fix build_url_request when method is None (#1041)
1 parent 6bc7fd6 commit a5d9740

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tron/commands/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def build_url_request(uri, data, headers=None, method=None):
5454
headers = headers or default_headers
5555
enc_data = urllib.parse.urlencode(data).encode() if data else None
5656
# Currently implementing auth only for management actions (i.e. POST requests)
57-
if os.getenv("TRONCTL_API_AUTH") and (data or method.upper() == "POST"):
57+
if os.getenv("TRONCTL_API_AUTH") and (data or (method and method.upper() == "POST")):
5858
token = get_sso_auth_token()
5959
if token:
6060
headers["Authorization"] = f"Bearer {token}"

0 commit comments

Comments
 (0)