When a search engine is enabled, if I type in the address bar a single word then the page loads as https://thatword
/. However if I type multiple words it works as expected.
If I put in the following dbgln's
diff --git a/Ladybird/Qt/LocationEdit.cpp b/Ladybird/Qt/LocationEdit.cpp
index 7dc4336331..3a23be952c 100644
--- a/Ladybird/Qt/LocationEdit.cpp
+++ b/Ladybird/Qt/LocationEdit.cpp
@@ -38,6 +38,8 @@ LocationEdit::LocationEdit(QWidget* parent)
search_engine_url = Settings::the()->search_engine().query_url;
auto query = ak_string_from_qstring(text());
+ dbgln("query={}, engine_url={}", query, search_engine_url);
+ dbgln("sanitized_url={}", WebView::sanitize_url(query, search_engine_url));
if (auto url = WebView::sanitize_url(query, search_engine_url); url.has_value())
setText(qstring_from_ak_string(url->serialize()));
The I get the following in the logs:
294966.228 Ladybird(680721): query=a, engine_url=https://duckduckgo.com/?q={}
294966.228 Ladybird(680721): sanitized_url=https://a/
294966.280 RequestServer(680723:680748): ConnectionCache: Connection to https://a/ failed: Temporary failure in name resolution
294966.280 RequestServer(680723:680748): Request with a null socket finished for URL https://a/
294966.280 WebContent(680757): ResourceLoader: Failed load of: "https://a/", Error: Load failed, Duration: 45ms
294973.648 Ladybird(680721): query=a a, engine_url=https://duckduckgo.com/?q={}
294973.648 Ladybird(680721): sanitized_url=https://duckduckgo.com/?q=a%20a
So the issue is likely in WebView::sanitize_url
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too