Skip to content

Commit

Permalink
fix quote_via not compatible with Python2 (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyBoyFeng committed Apr 16, 2021
1 parent 18c7386 commit ccd96df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dns/alidns.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ def signature(params):
'SignatureNonce': uuid4(),
'SignatureVersion': "1.0",
})
query = urlencode(sorted(params.items()), quote_via=quote)
query = urlencode(sorted(params.items()))
query = query.replace('+','%20')
debug(query)
sign = API.METHOD + "&" + quote_plus("/") + "&" + quote(query)
sign = API.METHOD + "&" + quote_plus("/") + "&" + quote(query, safe='')
debug("signString: %s", sign)

sign = hmac((Config.TOKEN + "&").encode('utf-8'),
Expand Down

0 comments on commit ccd96df

Please sign in to comment.