Skip to content

Commit

Permalink
Add picking of encoding for url encoded data
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed May 12, 2016
1 parent 9be649f commit 0f17249
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/script/dom/htmlformelement.rs
Expand Up @@ -321,7 +321,7 @@ impl HTMLFormElement {

result.push_str(&*format!("\r\n--{}--", boundary));

return result;
result
}

/// [Form submission](https://html.spec.whatwg.org/multipage/#concept-form-submit)
Expand Down Expand Up @@ -377,6 +377,7 @@ impl HTMLFormElement {
load_data.headers.set(ContentType::form_url_encoded());

form_urlencoded::Serializer::new(String::new())
.encoding_override(Some(self.pick_encoding()))
.extend_pairs(form_data.into_iter().map(|field| (field.name.clone(), field.value_str())))
.finish()
}
Expand Down

0 comments on commit 0f17249

Please sign in to comment.