LibURL: Use a nonce to distinguish opaque origins

Opaque origins are meant to be unique in terms of equality from
one another. Since this uniqueness needs to be across processes,
use a nonce to implement the uniqueness check.
This commit is contained in:
Shannon Booth 2025-06-17 14:49:37 +12:00 committed by Tim Ledbetter
commit 38765fd617
Notes: github-actions[bot] 2025-06-25 15:48:27 +00:00
7 changed files with 77 additions and 24 deletions

View file

@ -105,8 +105,10 @@ template<>
ErrorOr<URL::Origin> decode(Decoder& decoder)
{
auto is_opaque = TRY(decoder.decode<bool>());
if (is_opaque)
return URL::Origin::create_opaque();
if (is_opaque) {
auto nonce = TRY(decoder.decode<URL::Origin::Nonce>());
return URL::Origin { nonce };
}
auto scheme = TRY(decoder.decode<Optional<String>>());
auto host = TRY(decoder.decode<URL::Host>());