Skip to content

Commit 9f543e8

Browse files
committed
Stringify kwargs before escaping them
kwargs can contain numeric values that urllib.parse.quote() doesn't properly escape because they aren't strings. Force these to be escaped as strings.
1 parent a184b10 commit 9f543e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netbox/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def get(self, param, key=None, limit=0, **kwargs):
8282

8383
if kwargs:
8484
url = '{}{}?{}&limit={}'.format(self.base_url, param,
85-
'&'.join('{}={}'.format(key, urllib.parse.quote(val)) for key, val in kwargs.items()), limit)
85+
'&'.join('{}={}'.format(key, urllib.parse.quote(str(val))) for key, val in kwargs.items()), limit)
8686
elif key:
8787
if '_choices' in param:
8888
url = '{}{}{}/?limit={}'.format(self.base_url, param, key, limit)

0 commit comments

Comments
 (0)