MattIPv4 / DNS-over-Discord

1.1.1.1 works from a Discord server, thanks to the 1.1.1.1 bot. Invite the bot to your Discord server to start using DNS over Discord.
https://dns-over-discord.v4.wtf/invite
Apache License 2.0
281 stars 31 forks source link

Unformatted dates in cached whois responses #58

Closed d1snin closed 2 years ago

d1snin commented 2 years ago

Look at the following screenshot:

image

Here's the root cause (I think so): https://github.com/MattIPv4/DNS-over-Discord/blob/482d0d071b11a3ba14652d5a1bb5cf318f961a9b/src/utils/cache.js#L13

When an uncached lookup is executed, it is cached and returned (without using JSON.stringify) here. As a result, these dates are displayed in a valid format (here). But when the result is cached (as a result of JSON.stringify), the date loses its type and therefore being toString()'d here (well, I'm not sure, I personally don't like JS btw).