mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
AK: Set default port in URL to 1965 for gemini protocol
This commit is contained in:
parent
f2621f37a4
commit
4214680e76
Notes:
sideshowbarker
2024-07-19 06:34:08 +09:00
Author: https://github.com/deoxxa Commit: https://github.com/SerenityOS/serenity/commit/4214680e767 Pull-request: https://github.com/SerenityOS/serenity/pull/2218 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bugaevc
1 changed files with 3 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue