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

12 lines
293 B
TypeScript

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;
}