This commit is contained in:
2025-05-28 17:10:45 +03:00
parent d585219aa3
commit 5f80666cea
5 changed files with 38 additions and 18 deletions

View File

@@ -20,7 +20,7 @@
document.getElementById('getSecretValue').addEventListener('click', async () => {
const tmp = Math.floor(Date.now() / 1000);
const secretValue = get_secret_value(
BigInt(tmp),
getHTTPFormattedTime(),
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36',
'/api/v1/guestlogin'
);
@@ -62,6 +62,24 @@
}
}
function getHTTPFormattedTime() {
const now = new Date();
const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const day = days[now.getUTCDay()];
const date = now.getUTCDate().toString().padStart(2, '0');
const month = months[now.getUTCMonth()];
const year = now.getUTCFullYear();
const hours = now.getUTCHours().toString().padStart(2, '0');
const minutes = now.getUTCMinutes().toString().padStart(2, '0');
const seconds = now.getUTCSeconds().toString().padStart(2, '0');
return `${day}, ${date} ${month} ${year} ${hours}:${minutes}:${seconds} GMT`;
}
const httpTime = getHTTPFormattedTime();
runWasm();