This change removes '/' from the set of "safe" characters for the python urllib quote function.

When using PathParams containing a '/' character, the Python client does not encode the '/'. As a result, the / is interpreted as a path separator rather than a parameter value. PathSegments must encode the / character for proper transfer of information. e.g. 'my/string' should be encoded to 'my%2Fstring' for correct transmission of a PathParam argument. Path separators must only be used between path segments.
This commit is contained in:
Jon Hartlaub 2017-02-03 03:24:15 -08:00 committed by wing328
parent 695417699c
commit c366f139e2

View File

@ -107,7 +107,7 @@ class ApiClient(object):
collection_formats)
for k, v in path_params:
resource_path = resource_path.replace(
'{%s}' % k, quote(str(v), safe=""))
'{%s}' % k, quote(str(v), safe='')) # no safe chars, encode everything
# query parameters
if query_params: