From bf5a65d934aad670d7d7b8635cd16200b3788ea3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 10 Oct 2019 22:06:25 +0200 Subject: [PATCH] URL: No need to include ":80" when serializing http:// URLs --- AK/URL.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AK/URL.cpp b/AK/URL.cpp index 0ddcecd170..dc5286e620 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -125,8 +125,10 @@ String URL::to_string() const builder.append("://"); if (protocol() != "file") { builder.append(m_host); - builder.append(':'); - builder.append(String::number(m_port)); + if (protocol() != "http" || port() != 80) { + builder.append(':'); + builder.append(String::number(m_port)); + } } builder.append(m_path); return builder.to_string();