diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-09-13 23:12:16 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-14 00:14:45 +0200 |
commit | d6cfa34667fe808975279c237d4ac9fe612631d8 (patch) | |
tree | 76a873fbbd1af254048bc4b1104c72cd589df34b /Userland/Libraries/LibWeb/DOM/Document.cpp | |
parent | 1c9c43785d0f3b810e581a6d3267e52f566733b4 (diff) | |
download | serenity-d6cfa34667fe808975279c237d4ac9fe612631d8.zip |
AK: Make URL::m_port an Optional<u16>, Expose raw port getter
Our current way of signalling a missing port with m_port == 0 was
lacking, as 0 is a valid port number in URLs.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Document.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 0a26a2f214..2cfa9a55c2 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -134,7 +134,7 @@ Origin Document::origin() const { if (!m_url.is_valid()) return {}; - return { m_url.protocol(), m_url.host(), m_url.port() }; + return { m_url.protocol(), m_url.host(), m_url.port_or_default() }; } void Document::set_origin(const Origin& origin) |