summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
diff options
context:
space:
mode:
authorLuke <luke.wilde@live.co.uk>2021-06-01 13:08:30 +0100
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-01 23:26:03 +0430
commit70a575d75f88282b6c3bce1b52273f8d01c8a8b1 (patch)
tree68fb72990fb48abd3c2574f612b0a6e26ae1481d /Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
parent944855ca185f4d6a1587c174752446752775e040 (diff)
downloadserenity-70a575d75f88282b6c3bce1b52273f8d01c8a8b1.zip
LibWeb: Use correct percent encode set for form submissions
We currently only support application/x-www-form-urlencoded for form submissions, which uses a special percent encode set when percent encoding the body/query. However, we were not using this percent encode set. With the new URL implementation, we can now specify the percent encode set to be used, allowing us to use this special percent encode set. This is one of the fixes needed to make the Google cookie consent work.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
index 53c5c45137..fb104c377a 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
@@ -105,14 +105,14 @@ void HTMLFormElement::submit_form(RefPtr<HTMLElement> submitter, bool from_submi
});
if (effective_method == "get") {
- url.set_query(urlencode(parameters));
+ url.set_query(urlencode(parameters, URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded));
}
LoadRequest request;
request.set_url(url);
if (effective_method == "post") {
- auto body = urlencode(parameters).to_byte_buffer();
+ auto body = urlencode(parameters, URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded).to_byte_buffer();
request.set_method("POST");
request.set_header("Content-Type", "application/x-www-form-urlencoded");
request.set_header("Content-Length", String::number(body.size()));