Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DuckDuckGo HTML search #22354

Merged
merged 3 commits into from Dec 22, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Don't alter query string when submitting form by POST.

  • Loading branch information
jdm committed Dec 17, 2018
commit 1c7cfafcc5891d1f07bf640e2d697c36d65a3222
@@ -459,15 +459,16 @@ impl HTMLFormElement {
.headers
.typed_insert(ContentType::from(mime::APPLICATION_WWW_FORM_URLENCODED));

self.set_encoding_override(load_data.url.as_mut_url().query_pairs_mut())
let mut url = load_data.url.clone();
self.set_encoding_override(url.as_mut_url().query_pairs_mut())
.clear()
.extend_pairs(
form_data
.into_iter()
.map(|field| (field.name.clone(), field.replace_value(charset))),
);

load_data.url.query().unwrap_or("").to_string().into_bytes()
url.query().unwrap_or("").to_string().into_bytes()
},
FormEncType::FormDataEncoded => {
let mime: Mime = format!("multipart/form-data; boundary={}", boundary)
"support"
],
"common/form-submission.py": [
"467875453c9dc64aac51add3f4a617d941820972",
"b296ac44c57c658ca9e3189e9f79b0f80677acba",
"support"
],
"common/get-host-info.sub.js": [
"testharness"
],
"html/semantics/forms/form-submission-0/submit-entity-body.html": [
"8363f39ff32cd165a28086b3c594b55a79ced8e5",
"a52bb0dcd2080eabb44ab1ddca379da6a5e5ea9a",
"testharness"
],
"html/semantics/forms/form-submission-0/submit-file.sub.html": [
@@ -6,5 +6,7 @@ def main(request, response):
else:
result = request.POST.first('foo') == 'bar'

result = result and request.url_parts.query == 'query=1'

return ([("Content-Type", "text/plain")],
"OK" if result else "FAIL")
@@ -96,7 +96,7 @@
var testframe = document.getElementById("testframe");
var testdocument = testframe.contentWindow.document;
testdocument.body.innerHTML =
"<form id=testform method=post action=\"form-submission.py\" enctype=\"" + test_obj.enctype + "\">" +
"<form id=testform method=post action=\"form-submission.py?query=1\" enctype=\"" + test_obj.enctype + "\">" +
test_obj.input +
test_obj.submitelement +
"</form>";
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.