forwardemail / nodejs-dns-over-https-tangerine

Node.js DNS over HTTPS - :tangerine: Tangerine is the best drop-in replacement for dns.promises.Resolver using DNS over HTTPS ("DoH") via undici with built-in retries, timeouts, smart server rotation, AbortControllers, and caching support for multiple backends (with TTL and purge support). Made for @forwardemail.
https://forwardemail.net/docs/node-js-dns-over-https
MIT License
148 stars 8 forks source link

[feat] cache dummy-proofing #2

Closed titanism closed 1 year ago

titanism commented 1 year ago

Describe the feature

When cache is retrieved, dependent on the type, if the result is not of the proper type (e.g. it's an Array instead of an Object) then set data = undefined which will cause the cache to be purged/reset. This was a feature we built-in to Forward Email when we used to use dns.promises.Resolver.

Note: this is a super edge case, but is dummy-proofing in case of a bad redis set, or if a developer manually edited the cache value for whatever reason.

Checklist

titanism commented 1 year ago

Not going to fix as it's unnecessary right now