mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
AK: Allow file:// URLs to have a hostname
This commit is contained in:
parent
68991855ef
commit
15601988a4
1 changed files with 2 additions and 5 deletions
|
@ -103,9 +103,6 @@ bool URL::parse(const StringView& string)
|
||||||
m_port = 80;
|
m_port = 80;
|
||||||
else if (m_protocol == "https")
|
else if (m_protocol == "https")
|
||||||
m_port = 443;
|
m_port = 443;
|
||||||
if (m_protocol == "file")
|
|
||||||
state = State::InPath;
|
|
||||||
else
|
|
||||||
state = State::InHostname;
|
state = State::InHostname;
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
continue;
|
continue;
|
||||||
|
@ -253,8 +250,8 @@ String URL::to_string() const
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.append("://");
|
builder.append("://");
|
||||||
if (protocol() != "file") {
|
|
||||||
builder.append(m_host);
|
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)) {
|
||||||
builder.append(':');
|
builder.append(':');
|
||||||
builder.append(String::number(m_port));
|
builder.append(String::number(m_port));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue