Skip to content

Commit 785aec4

Browse files
committed
casting number to integer when parsing ttl
1 parent 3acf245 commit 785aec4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/v1/internal/routing-util.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export default class RoutingUtil {
6161
parseTtl(record, routerAddress) {
6262
try {
6363
const now = int(Date.now());
64-
const expires = record.get('ttl').multiply(1000).add(now);
64+
const ttl = record.get('ttl');
65+
const expires = (typeof ttl === 'number' ? int(ttl) : ttl).multiply(1000).add(now);
6566
// if the server uses a really big expire time like Long.MAX_VALUE this may have overflowed
6667
if (expires.lessThan(now)) {
6768
return Integer.MAX_VALUE;

0 commit comments

Comments
 (0)