You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a bug where domainMatch() returns false unexpectedly when the domStr argument (top-level-domain) can be found elsewhere in the domain (str argument). For example:
❌ Broken:
require('tough-cookie').domainMatch('computer.com','com');// false - should be true
Thanks for the bug report @davidofwatkins. I'll look into this as soon as possible. But don't let that deter you from submitting your own PR with a fix if you have one.
There's a bug where
domainMatch()
returnsfalse
unexpectedly when thedomStr
argument (top-level-domain) can be found elsewhere in the domain (str
argument). For example:❌ Broken:
✅ Working:
The issue appears to come from the
indexOf()
check here:tough-cookie/lib/cookie.js
Line 371 in 30246e6
...causing this calculation to fail:
tough-cookie/lib/cookie.js
Lines 379 to 381 in 30246e6
The text was updated successfully, but these errors were encountered: