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

Allow .local suffix domains for testing purposes #160

Closed
miggs125 opened this issue Jun 21, 2019 · 0 comments · Fixed by #173
Labels
Projects

Comments

@miggs125
Copy link
Contributor

@miggs125 miggs125 commented Jun 21, 2019

Hi,

I am using request (which uses tough-cookie) to test a web app that is hosted on a domain ending with a .local suffix (ex: http://foo.bar.local). Once the app's server receives a GET request, it sends back a redirect status with a set-cookie header along with authentication cookies. Each containing a .bar.local domain. When the client responds to the redirect, it attempts to put the stored cookies in the response header. This fails as the permuteDomain function (permuteDomain.js) calls the psl.get(domain) method in order to obtain the public suffix of the current page (in this case foo.bar.local). This method returns null when it is passed a domain ending in .local. This causes permuteDomain to set the list of permutations to contain foo.bar.local as the only permutation in this list. Consequently, the cookies fail to be added to the response header in the MemoryCookieStore.findCookies method.

Testing on a .local domain is fairly commonplace and, correct me if I am wrong, but .local is considered public suffix. If the rejectPublicSuffixes option is initially set to false, shouldn't .local domains be allowed as well? This boolean could be passed down to findCookies and permuteDomain, allowing the function to find the permutations of domains ending with a .local suffix. I would be happy to implement this and submit a PR.

@awaterma awaterma added this to To do in Kanban Jul 1, 2019
This was referenced Oct 5, 2019
Kanban automation moved this from To do to Done Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Kanban
  
Done
2 participants
You can’t perform that action at this time.