LibURL: Differentiate cross site opaque origins

Previously if we had two opaque origins both URLs were
being treated as same site.
This commit is contained in:
Shannon Booth 2025-06-30 15:19:27 +12:00 committed by Tim Ledbetter
commit bd67a5afaa
Notes: github-actions[bot] 2025-06-30 07:07:49 +00:00
2 changed files with 21 additions and 2 deletions

View file

@ -36,9 +36,8 @@ bool Site::is_same_site(Site const& other) const
{
// 1. If A and B are the same opaque origin, then return true.
// NOTE: Origins in sites are always opaque.
// FIXME: Currently all opaque origins are identical, how should we distinguish them?
if (m_value.has<Origin>() && other.m_value.has<Origin>())
return true;
return m_value.get<Origin>().nonce() == other.m_value.get<Origin>().nonce();
// 2. If A or B is an opaque origin, then return false.
if (m_value.has<Origin>() || other.m_value.has<Origin>())