Skip to content

Commit

Permalink
update apypie with quote version
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jun 14, 2023
1 parent c113a59 commit 0056ca4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/module_utils/_apypie.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,11 @@ def call(self, action, params=None, headers=None, options=None, data=None, files
Apypie Route module
"""

try:
from urllib.parse import quote # type: ignore
except ImportError:
from urllib import quote # type: ignore


class Route(object):
"""
Expand Down Expand Up @@ -901,7 +906,7 @@ def path_with_params(self, params=None):
if params is not None:
for param in self.params_in_path:
if param in params:
result = result.replace(':{}'.format(param), str(params[param]))
result = result.replace(':{}'.format(param), quote(str(params[param]), safe=''))
else:
raise KeyError("missing param '{}' in parameters".format(param))
return result

0 comments on commit 0056ca4

Please # to comment.