Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubsuffix-psl isn't recognizing localhost correctly #248

Closed
CSchulz opened this issue Aug 23, 2022 · 1 comment
Closed

pubsuffix-psl isn't recognizing localhost correctly #248

CSchulz opened this issue Aug 23, 2022 · 1 comment

Comments

@CSchulz
Copy link

CSchulz commented Aug 23, 2022

I have seen that the implementation of pubsuffix-psl isn't recognizing localhost correctly.

I have checked the complete stacktrace for our local environment using localhost as URL.

CookieJar.getCookieStringSync(this.URL, { http: false })
CookieJar.getCookieString(this.URL, { http: false })
CookieJar.getCookies(this.URL, { http: false })
Memstore.findCookies(host = 'localhost', path = '/', allowSpecialUseDomain = true)
permuteDomain(domain = 'localhost', allowSpecialUseDomain = true)
pubsuffix.getPublicSuffix(domain = 'localhost', allowSpecialUseDomain = true)

The getPublicSuffix function needs to be called with ignoreError to prevent throwing an error.
In my honest opinion the throw should handle ignoreError and allowSpecialUseDomain cases.

ignoreError: true, allowSpecialUseDomain: false -> no Error
ignoreError: true, allowSpecialUseDomain: true -> no Error
ignoreError: false, allowSpecialUseDomain: false -> throw Error
ignoreError: false, allowSpecialUseDomain: false -> no Error

https://github.com/salesforce/tough-cookie/blob/master/lib/pubsuffix-psl.js#L43-L68

Workaround: use localhost.local for your environment to skip this issue.

@awaterma
Copy link
Member

We really don't need two issues opened on this in the tracker. :) We are working on a fix and a patch release for tomorrow.

Please continue to reference the issue in #246!

@awaterma awaterma closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants