you guessed it - another bug
April 25, 2014 @ 00:37
Found another bug and made a pull request - this time in the ‘rauth’ library, which does OAuth in a reasonable sane way.
Except for this issue - I still have no idea why they’re trying to parse the
OAuth response with a utility used for parsing HTTP requests, but hey, I
guess if it works for them, fine. For me though, I need to replace their use of
parse_utf8_qsl(s)
with json.loads(s.decode())
because my response is proper
JSON - shouldn’t OAuth responses be JSON anyway?
Whatever, it’s late.
EDIT:
Okay so it turns out I was doing silly things like not reading the OAuth spec
and the response should be a query-string type thing like
oauth_token=foo&oauth_token_secret=bar
instead, which is what the library
parses just fine by default. Reading specs is a good plan, one I encourage
everyone to do.
My pull request is still valid though, if you really must break the spec, they have the parser argument already, and it should work in a more sensible way.