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

feat: 更新 apk-upload 的字段描述,并优化 golang 示例 #1242

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cn/docs/sdk/apk-upload/guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ import { Red, Blue, Black, Gray } from "/src/docComponents/doc";

参数说明如下

| 字段名 | 描述 | 示例 |
|--------------------|---------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| method | HTTP 方法,如 `GET` / `POST` (须为全部大写) | GET |
| url_path_and_query | 完整请求路径及 QueryString | /apk/v1/upload-params?app_id=58881&file_name=xxx.apk&client_id=rfciqabirt4vqav7io |
| headers | 所有以 `X-Tap-` 为前缀的请求头(`X-Tap-Sign` 除外),将其 keys 全部转小写并按字典排序后,key 和 value 以 `:` 分隔,各个 header 以换行符 `\n` 分隔,拼接成字符串 | x-tap-nonce:q1w2e3r4\nx-tap-ts:1692347090 |
| body | 请求体 | {"key":"value"} |
| 字段名 | 描述 | 示例 |
|--------------------|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| method | HTTP 方法,如 `GET` / `POST` (须为全部大写) | GET |
| url_path_and_query | 完整请求路径及 QueryString | /apk/v1/upload-params?app_id=58881&file_name=xxx.apk&client_id=rfciqabirt4vqav7io |
| headers | 所有以 `X-Tap-` 为前缀的请求头(`X-Tap-Sign` 除外),将其 keys 全部转小写并按 ASCII 排序后,key 和 value 以 `:` 分隔,各个 header 以换行符 `\n` 分隔,拼接成字符串 | x-tap-nonce:q1w2e3r4\nx-tap-ts:1692347090 |
| body | 请求体 | {"key":"value"} |

#### 二、计算签名

Expand Down Expand Up @@ -136,7 +136,7 @@ Signature = Base64Encode(HMAC-SHA256(Server Secret, SignParts))

for k, v := range header {
k = strings.ToLower(k)
if !strings.HasPrefix(k, "x-tap-") {
if !strings.HasPrefix(k, "x-tap-") || k == "x-tap-sign" {
continue
}
if len(v) > 1 {
Expand Down
Loading