-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fix: get the top-level hostname #4935
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Passing run #8019 ↗︎
Details:
Review all test suite changes for PR #4935 ↗︎ |
b34e7aa
to
e41d864
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicky style/questions in there, but looks reasonable!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All just nits! 👍
break; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this exits and fails to save a cookie, what should we do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered about throwing an error, but I thought the only real world scenario where this happens is if the browser is blocking 1st party cookies. Should we do something a little more invasive, like a browser alert
to let the user know it's not going to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I propose we solve that separately. fides.js should probably check to see if cookies can be written prior to showing a banner at all. We should be thoughtful about how we want to handle it in that initialization phase.
Closes PROD-2126
Description Of Changes
IP addresses and top level hostnames that included multiple TLDs (like
co.uk
) were not working for setting a Fides Cookie.This fix update cookie setter to guarantee highest level domain allowed to set cookie. It relies on browser's own methods to determine viable domain.
Code Changes
Steps to Confirm
/etc/hosts
on your local machine to include new line:127.0.0.1 privacy.example.co.uk
http://privacy.example.co.uk:3001/fides-js-demo.html
example.co.uk
http://127.0.0.1:3001/fides-js-demo.html
and ensure that works.(domains like
www.fides.com
andlocalhost
should continue working with this enhancement in place)Pre-Merge Checklist
CHANGELOG.md