hexo/node_modules/ali-oss/lib/common/object/getObjectMeta.js

24 lines
623 B
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
const proto = exports;
/**
* getObjectMeta
* @param {String} name - object name
* @param {Object} options
* @param {{res}}
*/
proto.getObjectMeta = async function getObjectMeta(name, options) {
options = options || {};
name = this._objectName(name);
options.subres = Object.assign({ objectMeta: '' }, options.subres);
if (options.versionId) {
options.subres.versionId = options.versionId;
}
const params = this._objectRequestParams('HEAD', name, options);
params.successStatuses = [200];
const result = await this.request(params);
return {
status: result.status,
res: result.res
};
};