Browse Source

AK+LibWeb: Remove URL::to_string_encoded()

This replaces URL::to_string_encoded() with to_string() and removes the
former, since they are now equivalent.
Max Wipfli 4 years ago
parent
commit
33396494f6

+ 0 - 2
AK/URL.h

@@ -79,9 +79,7 @@ public:
 
     String serialize(ExcludeFragment = ExcludeFragment::No) const;
     String serialize_for_display() const;
-
     String to_string() const { return serialize(); }
-    String to_string_encoded() const { return serialize(); }
 
     bool equals(URL const& other, ExcludeFragment = ExcludeFragment::No) const;
 

+ 1 - 1
Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp

@@ -156,7 +156,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte
             headers.set(it.key, it.value);
         }
 
-        auto protocol_request = protocol_client().start_request(request.method(), url.to_string_encoded(), headers, request.body());
+        auto protocol_request = protocol_client().start_request(request.method(), url.to_string(), headers, request.body());
         if (!protocol_request) {
             if (error_callback)
                 error_callback("Failed to initiate load", {});

+ 2 - 1
Userland/Libraries/LibWeb/OutOfProcessWebView.cpp

@@ -52,7 +52,8 @@ void OutOfProcessWebView::handle_web_content_process_crash()
         builder.appendff(" on {}", escape_html_entities(m_url.host()));
     }
     builder.append("</h1>");
-    builder.appendff("The web page <a href=\"{}\">{}</a> has crashed.<br><br>You can reload the page to try again.", escape_html_entities(m_url.to_string_encoded()), escape_html_entities(m_url.to_string()));
+    auto escaped_url = escape_html_entities(m_url.to_string());
+    builder.appendff("The web page <a href=\"{}\">{}</a> has crashed.<br><br>You can reload the page to try again.", escaped_url, escaped_url);
     builder.append("</body></html>");
     load_html(builder.to_string(), m_url);
 }