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
With callback url there can be additional parameters such as next as well as the oauth_token and oauth_verificer, and there can be unquoted strings in it.
For example, my callback url was: "/login/twitter-callback?next=ㅋㅋ&oauth_token=<redacted>&oauth_verifier=<redacted>"
Calling OAuth1Session.parse_authorization_response on above url yields an error:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
But this is not the culprit because of how urldecode is coded to ignore failed urldecode attempts:
defurldecode(body):
"""Parse query or json to python dictionary"""try:
return_urldecode(body)
exceptException: # <-importjsonreturnjson.loads(body)
The real error is:
ValueError: Error trying to decode a non urlencoded string. Found invalid characters: {'ㅋ'} in the string: 'next=ㅋ&oauth_token=<redacted>&oauth_verifier=<redacted>'. Please ensure the request/response body is x-www-form-urlencoded.
With callback url there can be additional parameters such as
next
as well as theoauth_token
andoauth_verificer
, and there can be unquoted strings in it.For example, my callback url was:
"/login/twitter-callback?next=ㅋㅋ&oauth_token=<redacted>&oauth_verifier=<redacted>"
Calling
OAuth1Session.parse_authorization_response
on above url yields an error:But this is not the culprit because of how
urldecode
is coded to ignore failed urldecode attempts:The real error is:
You can reproduce this error with this code:
The text was updated successfully, but these errors were encountered: