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

Unit test cases for allowSpecialUseDomain option #225

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

colincasey
Copy link
Contributor

This PR adds test cases for the allowSpecialUseDomain option introduced in PR #173. The special use domain check was changed to be a refinement on the public suffix check since both setting and retrieving cookies can fail since not all special use domains are considered public suffixes.

The following cases are tested:

  • when the cookie jar is configured with allowSpecialUseDomain=true, the code will skip the lookup of a public suffix when a special use domain is detected
  • when the cookie jar is configured with allowSpecialUseDomain=false, the code will raise an error describing proper usage when a special use domain is detected

Fixes #206

This PR adds test cases for the `allowSpecialUseDomain` option introduced in [PR salesforce#173](salesforce#173).  The special use domain check was changed to be a refinement on the public suffix check since both setting and retrieving cookies can fail since not all special use domains are considered public suffixes.

The following cases are tested:
* when the cookie jar is configured with `allowSpecialUseDomain=true`, the code will skip the lookup of a public suffix when a special use domain is detected
* when the cookie jar is configured with `allowSpecialUseDomain=false`, the code will raise an error describing proper usage when a special use domain is detected
@awaterma
Copy link
Member

I should have some time to review this today; sorry for the delay! :)

@awaterma
Copy link
Member

I've merged in our latest changes; should be able to take a deeper look at the implementation this afternoon.

Copy link
Member

@awaterma awaterma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; nice changes, I think a bit clearer now.

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

Successfully merging this pull request may close these issues.

Write test cases for PR 173
3 participants