Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix signatures when no parameters are specified in MEXC #250

Merged
merged 1 commit into from Jan 9, 2024
Merged

Conversation

MtkN1
Copy link
Member

@MtkN1 MtkN1 commented Jan 9, 2024

Summary

MEXC の認証ロジックにて、パラメータなしの GET リクエストなどが正常に署名されない問題を修正します。

再現例:

async def main():
    async with pybotters.Client(base_url="https://api.mexc.com") as client:
        r = await client.fetch("GET", "/api/v3/account")
        print(repr(r.response).splitlines()[0])
        print(r.data)
<ClientResponse(https://api.mexc.com/api/v3/account) [400 Bad Request]>
{'code': 700004, 'msg': "Mandatory parameter 'signature' was not sent, was empty/null, or malformed."}

Changes

  • この変更の副作用にて、pybotters が自動付与する署名情報 signature は GET 系リクエストでは URL クエリ、POST 系リクエストではボディに付与されていましたが、リクエスト方法を問わずに URL クエリに付与されるようになります。

@MtkN1 MtkN1 self-assigned this Jan 9, 2024
@MtkN1 MtkN1 merged commit 85ed607 into main Jan 9, 2024
11 checks passed
@MtkN1 MtkN1 deleted the fix-mexc-auth branch January 9, 2024 02:29
This was referenced Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant