Skip to content

Commit f3cba51

Browse files
committed
uppercase method once
1 parent 710dbf9 commit f3cba51

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cloudflare_v4/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@
1717
def call(auth, method, endpoint, params=None):
1818
headers = { "X-Auth-Email": auth['EMAIL'], "X-Auth-Key": auth['TOKEN'] }
1919
url = BASE_URL + '/' + endpoint
20+
method = method.upper()
2021
logger.debug("auth is: " + str(auth))
2122
logger.debug("method type is: " + method)
2223
logger.debug("url endpoint is: " + url)
2324
logger.debug("optional params is: " + str(params))
2425
if (auth is None) or (method is None) or (endpoint is None):
2526
raise CloudFlareError('You must specify auth, method, and endpoint')
2627
else:
27-
if method.upper() == 'GET':
28+
if method == 'GET':
2829
logger.debug("headers being sent: " + str(headers))
2930
response = requests.get(url, headers=headers, params=params)
30-
elif method.upper() == 'POST':
31+
elif method == 'POST':
3132
headers['Content-Type'] = 'application/json'
3233
logger.debug("headers being sent: " + str(headers))
3334
response = requests.post(url, headers=headers, json=params)

0 commit comments

Comments
 (0)