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
Closed

Allow .local suffix domains for testing purposes #160

miggs125 opened this issue Jun 21, 2019 · 0 comments · Fixed by #173
Labels
patch We expect this work to be a patch level change starter Work that would be good for those getting started with the project
Projects

Comments

@miggs125
Copy link
Contributor

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 4.x Release Jul 1, 2019
@awaterma awaterma added patch We expect this work to be a patch level change starter Work that would be good for those getting started with the project labels Jul 1, 2019
This was referenced Oct 5, 2019
4.x Release 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
Labels
patch We expect this work to be a patch level change starter Work that would be good for those getting started with the project
Projects
No open projects
4.x Release
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants