fix: use compact JSON (no spaces) for body hash consistency

This commit is contained in:
yumoqing 2026-05-29 18:48:45 +08:00
parent 2fd15eeb1e
commit 1b6c51f712

View File

@ -70,8 +70,8 @@ async def call_volcengine_api(vendor, operation, params, api_mapping):
x_date = now.strftime("%Y%m%dT%H%M%SZ")
short_x_date = x_date[:8]
# Payload
body = json.dumps(params, ensure_ascii=False)
# Payload - compact JSON (no extra spaces)
body = json.dumps(params, ensure_ascii=False, separators=(',', ':'))
x_content_sha256 = _hash_sha256(body)
# Query params: Action + Version