You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
parttimejob/node_modules/ali-oss/lib/common/object/getSymlink.js

24 lines
666 B

const proto = exports;
/**
* getSymlink
* @param {String} name - object name
* @param {Object} options
* @param {{res}}
*/
proto.getSymlink = async function getSymlink(name, options = {}) {
options.subres = Object.assign({ symlink: '' }, options.subres);
if (options.versionId) {
options.subres.versionId = options.versionId;
}
name = this._objectName(name);
const params = this._objectRequestParams('GET', name, options);
params.successStatuses = [200];
const result = await this.request(params);
const target = result.res.headers['x-oss-symlink-target'];
return {
targetName: decodeURIComponent(target),
res: result.res
};
};