mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibURL: Clarify whether an Origin is opaque
Origins are immutable and we know on construction whether an Origin is opaque. This also removes an implicit reliance on Host's Empty state.
This commit is contained in:
parent
3124dca528
commit
8b984c0c57
Notes:
github-actions[bot]
2024-11-30 11:24:16 +00:00
Author: https://github.com/AtkinsSJ
Commit: 8b984c0c57
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2610
Reviewed-by: https://github.com/shannonbooth ✅
4 changed files with 40 additions and 19 deletions
|
@ -100,6 +100,10 @@ ErrorOr<URL::URL> decode(Decoder& decoder)
|
|||
template<>
|
||||
ErrorOr<URL::Origin> decode(Decoder& decoder)
|
||||
{
|
||||
auto is_opaque = TRY(decoder.decode<bool>());
|
||||
if (is_opaque)
|
||||
return URL::Origin {};
|
||||
|
||||
auto scheme = TRY(decoder.decode<ByteString>());
|
||||
auto host = TRY(decoder.decode<URL::Host>());
|
||||
auto port = TRY(decoder.decode<Optional<u16>>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue