Skip to content
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
5 changes: 2 additions & 3 deletions plugins/openclaw-weixin/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ function randomWechatUin(): string {
return Buffer.from(String(uint32), "utf-8").toString("base64");
}

function buildHeaders(opts: { token?: string; body: string }): Record<string, string> {
function buildHeaders(opts: { token?: string }): Record<string, string> {
const headers: Record<string, string> = {
"Content-Type": "application/json",
AuthorizationType: "ilink_bot_token",
"Content-Length": String(Buffer.byteLength(opts.body, "utf-8")),
"X-WECHAT-UIN": randomWechatUin(),
};
if (opts.token?.trim()) {
Expand Down Expand Up @@ -99,7 +98,7 @@ async function apiFetch(params: {
}): Promise<string> {
const base = ensureTrailingSlash(params.baseUrl);
const url = new URL(params.endpoint, base);
const hdrs = buildHeaders({ token: params.token, body: params.body });
const hdrs = buildHeaders({ token: params.token });
logger.debug(`POST ${redactUrl(url.toString())} body=${redactBody(params.body)}`);

const controller = new AbortController();
Expand Down
Loading