You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like ParametersNameDecodingHandler middleware is a workaround that should only affect query parameter names, without replacing values and adding new parameters.
However, the code below is corrupting all parameter values that contain escaped meaningful URL symbols like +, =, ?, & - the latter may add extra parameter names into the URL
fromurllib.parseimportunquotefromhttpximportURLoriginal=URL("https://google.com?q=1%2b2") # search for "1+2"updated=URL(unquote(str(original)))
assertupdated==URL('https://google.com?q=1+2') # corrupted, now searches for "1 2" !original=URL("https://google.com/?q=M%26A") # search for "M&A"updated=URL(unquote(str(original))) # corrupted, now searches for "M", adds separate A parameter !
This was extremely hard to find when it was resulting in SDK API errors with Invalid continuation token <TOKEN> passed where actually valid TOKEN that had + in the middle and also ends with =.
The text was updated successfully, but these errors were encountered:
Hi @ivan-klass
Thanks for your interest in kiota and for reaching out.
You're right in the sense that line 47 is an overbearing implementation that also decodes the value when it shouldn't. Its implementation also diverges from other languages although the other languages most likely suffer from the same issue.
Is this something you'd be willing to submit a pull request to fix? (align the implementation with other languages and correct the implementation so it only considers parameters names)
It seems like
ParametersNameDecodingHandler
middleware is a workaround that should only affect query parameter names, without replacing values and adding new parameters.However, the code below is corrupting all parameter values that contain escaped meaningful URL symbols like
+
,=
,?
,&
- the latter may add extra parameter names into the URLkiota-http-python/kiota_http/middleware/parameters_name_decoding_handler.py
Lines 40 to 48 in 63b8d93
This was extremely hard to find when it was resulting in SDK API errors with
Invalid continuation token <TOKEN> passed
where actually valid TOKEN that had+
in the middle and also ends with=
.The text was updated successfully, but these errors were encountered: