Auto merge of #22354 - jdm:ddg, r=Manishearth

Fix DuckDuckGo HTML search

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22090
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22354)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-12-21 23:32:12 -05:00 committed by GitHub
commit 9caf215beb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 13 deletions

View file

@ -459,7 +459,8 @@ 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
@ -467,7 +468,7 @@ impl HTMLFormElement {
.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)