hexo/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.ts

12 lines
293 B
TypeScript
Raw Normal View History

2023-10-03 11:14:36 +08:00
import { isObject } from './isObject';
export function lowercaseKeyHeader(headers) {
const lowercaseHeader = {};
if (isObject(headers)) {
Object.keys(headers).forEach(key => {
lowercaseHeader[key.toLowerCase()] = headers[key];
});
}
return lowercaseHeader;
}