diff options
author | Conrad Pankoff <deoxxa@fknsrs.biz> | 2020-05-16 10:19:17 +1000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-17 12:41:38 +0200 |
commit | 4214680e7671fd39daa840302fcdb19313559f35 (patch) | |
tree | f88ce934d8054e1155ab8db2400083b035b1d028 /AK | |
parent | f2621f37a4ce024a49e41755ea12d826e991fc1a (diff) | |
download | serenity-4214680e7671fd39daa840302fcdb19313559f35.zip |
AK: Set default port in URL to 1965 for gemini protocol
Diffstat (limited to 'AK')
-rw-r--r-- | AK/URL.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/AK/URL.cpp b/AK/URL.cpp index 123ba5c79d..6263a38ac9 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -109,6 +109,8 @@ bool URL::parse(const StringView& string) m_port = 80; else if (m_protocol == "https") m_port = 443; + else if (m_protocol == "gemini") + m_port = 1965; state = State::InHostname; buffer.clear(); continue; @@ -270,7 +272,7 @@ String URL::to_string() const builder.append("://"); builder.append(m_host); if (protocol() != "file") { - if (!(protocol() == "http" && port() == 80) && !(protocol() == "https" && port() == 443)) { + if (!(protocol() == "http" && port() == 80) && !(protocol() == "https" && port() == 443) && !(protocol() == "gemini" && port() == 1965)) { builder.append(':'); builder.append(String::number(m_port)); } |