MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / signHeader

Method signHeader

wxapp/vipshop.js:231–236  ·  view source on GitHub ↗
(url, data = {}, method = "POST")

Source from the content-addressed store, hash-verified

229 }
230
231 signHeader(url, data = {}, method = "POST") {
232 const pathOnly = url.replace(/^http(s)?:\/\/.*?\//, "/");
233 const secret = aesDecryptBase64(SIGN_SECRET_ENC);
234 const apiSign = sha1(`${pathOnly}${this.paramHash(data, method)}${this.token}${this.marsCid}${secret}`);
235 return `OAuth api_sign=${apiSign}`;
236 }
237
238 signedHeaders(url, data) {
239 const cookie = this.cookie();

Callers 1

signedHeadersMethod · 0.95

Calls 3

paramHashMethod · 0.95
aesDecryptBase64Function · 0.85
sha1Function · 0.70

Tested by

no test coverage detected