Remove None values from sig generation
This commit is contained in:
parent
63f4a8310e
commit
f5b80b6e63
@ -28,6 +28,8 @@ def get_sig(method, values, secret):
|
|||||||
""" Create a signature for parameters passed to VK API. """
|
""" Create a signature for parameters passed to VK API. """
|
||||||
postdata = ""
|
postdata = ""
|
||||||
for key in values:
|
for key in values:
|
||||||
|
# None values should be excluded from SIG, otherwise VK won't validate it correctly.
|
||||||
|
if values[key] != None:
|
||||||
postdata = postdata + "{key}={value}&".format(key=key, value=values[key])
|
postdata = postdata + "{key}={value}&".format(key=key, value=values[key])
|
||||||
# Remove the last "&" character.
|
# Remove the last "&" character.
|
||||||
postdata = postdata[:-1]
|
postdata = postdata[:-1]
|
||||||
|
Loading…
Reference in New Issue
Block a user