From 9641f7431015abd0222a440cb75fb3149ef70189 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 10 Dec 2019 21:13:00 +0100 Subject: AK: Teach URL::complete_url() how to resolve URL's starting with "/" --- AK/URL.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AK/URL.cpp b/AK/URL.cpp index a78ce8a9b4..45dcb2e4a8 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -157,8 +157,14 @@ URL URL::complete_url(const String& string) const if (url.is_valid()) return url; - FileSystemPath fspath(path()); + if (string.starts_with("/")) { + url = *this; + url.set_path(string); + return url; + } + StringBuilder builder; + FileSystemPath fspath(path()); builder.append('/'); bool document_url_ends_in_slash = path()[path().length() - 1] == '/'; -- cgit v1.2.3