MCPcopy Create free account
hub / github.com/aliyun/openapi-core-nodejs-sdk / buildStringToSign

Function buildStringToSign

lib/roa.js:68–80  ·  view source on GitHub ↗
(method, uriPattern, headers, query)

Source from the content-addressed store, hash-verified

66}
67
68function buildStringToSign(method, uriPattern, headers, query) {
69 const accept = headers['accept'];
70 const contentMD5 = headers['content-md5'] || '';
71 const contentType = headers['content-type'] || '';
72 const date = headers['date'] || '';
73
74 const header = `${method}\n${accept}\n${contentMD5}\n${contentType}\n${date}\n`;
75
76 const canonicalizedHeaders = getCanonicalizedHeaders(headers);
77 const canonicalizedResource = getCanonicalizedResource(uriPattern, query);
78
79 return `${header}${canonicalizedHeaders}${canonicalizedResource}`;
80}
81
82function parseXML(xml) {
83 const parser = new xml2js.Parser({

Callers 2

requestMethod · 0.85
roa.test.jsFile · 0.85

Calls 2

getCanonicalizedHeadersFunction · 0.85
getCanonicalizedResourceFunction · 0.85

Tested by

no test coverage detected