This repository has been archived by the owner on May 15, 2024. It is now read-only.
fix(createBrowserLikeFetch): configure tough-cookie for localhost #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Pass
allowSpecialUseDomains: true
togetPublicSuffix
.Motivation and Context
This allows you to use this when running locally. Otherwise you get this error:
[email protected] added an options parameter to
getPublicSuffix
and defaultedallowSpecialUseDomains
to false, which is a breaking change, but they never reverted it. Also the error message is incorrect, it's not the CookieJar that needs to be configured.https://github.com/salesforce/tough-cookie/blob/master/lib/pubsuffix-psl.ts#L45C17-L45C17
#50 worked around this by pinning to [email protected] but there is a security vulnerability in <4.1.3 so that is not ideal.
https://security.snyk.io/vuln/SNYK-JS-TOUGHCOOKIE-5672873
Note that dependabot PR #53 actually bumped the version to [email protected] so the bug fixed by #50 would have come back if a release had been done.
How Has This Been Tested?
Added unit test. Also packed and deployed to a module that was having this issue.
Types of Changes
Checklist:
What is the Impact to Developers Using fetch-enhancers?
Can upgrade to non-vulnerable tough-cookie.