Incorrect behavior in permuteDomain where domain has a trailing dot
ruoho-sfdc opened this issue · comments
Clint Ruoho commented
permuteDomain behaves incorrectly when called with a domain containing a trailing dot:
$ cat strange.js
const tough = require("./lib/cookie");
console.log('Permuting host.example.com.')
console.log(tough.permuteDomain("host.example.com."))
console.log('Permuting host.example.com')
console.log(tough.permuteDomain("host.example.com"))
$ node strange.js
Permuting host.example.com.
[ 'example.com', '.example.com', 'host..example.com' ]
Permuting host.example.com
[ 'example.com', 'host.example.com' ]