diff --git a/package.json b/package.json index 88f06f0..d590e2a 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ "eslint-plugin-prettier": "^4.2.1", "mocha": "^10.0.0", "prettier": "^2.8.7", - "ts-node": "^10.9.1", "ts-loader": "^9.4.4", + "ts-node": "^10.9.1", "typescript": "^5.0.3" } } diff --git a/src/sign.ts b/src/sign.ts index 554a5d5..fbb45d5 100644 --- a/src/sign.ts +++ b/src/sign.ts @@ -43,10 +43,8 @@ export async function sign(message: T, opt message.headers.set('Signature', `${key}=:${sigBase64}:`); message.headers.set('Signature-Input', `${key}=${signatureInputString}`); } else { - Object.assign(message.headers, { - Signature: `${key}=:${sigBase64}:`, - 'Signature-Input': `${key}=${signatureInputString}`, - }); + message.headers['Signature'] = `${key}=:${sigBase64}:`; + message.headers['Signature-Input'] = `${key}=${signatureInputString}`; } return message; diff --git a/src/types.ts b/src/types.ts index aa7d8c1..d6c9f0a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -22,7 +22,7 @@ interface HeadersMap { set(name: string, value: string): void; } -type Headers = Record | HeadersMap; +type Headers = Record | HeadersMap; export type HeaderValue = { toString(): string } | string | string[] | undefined;