Try to see if we can avoid timestamp issue

This commit is contained in:
Fang-Pen Lin
2025-11-21 21:18:35 -08:00
parent f7f8fd2595
commit 13022adc5e

View File

@@ -35,10 +35,10 @@ export const getDNSMadeEasyUrl = (path: string) => {
export const makeDNSMadeEasyAuthHeaders = (
apiKey: string,
secretKey: string,
currentDate: Date = new Date()
currentDate?: Date
): Record<string, string> => {
// Format date as "Day, DD Mon YYYY HH:MM:SS GMT" (e.g., "Mon, 01 Jan 2024 12:00:00 GMT")
const requestDate = currentDate.toUTCString();
const requestDate = (currentDate ?? new Date()).toUTCString();
// Generate HMAC-SHA1 signature
const hmac = crypto.nativeCrypto.createHmac("sha1", secretKey);