diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-05-27 05:21:05 -0500 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-05-27 05:21:05 -0500 |
commit | d87af8ac52b16a3763420fb7ad8fb45af785a23b (patch) | |
tree | ffbb9a1f719c29197d2387583c5e01c039f1cefd /components/script/dom/xmlhttprequest.rs | |
parent | df2f8d0636922a7e89895fa61fdba30099cec9ea (diff) | |
parent | 6802bafc399011726c51ca55fdde6d34f98430f1 (diff) | |
download | servo-d87af8ac52b16a3763420fb7ad8fb45af785a23b.tar.gz servo-d87af8ac52b16a3763420fb7ad8fb45af785a23b.zip |
Auto merge of #6192 - nox:cleanup-urlsearchparams, r=Manishearth
It now uses rust-url for its serializer.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6192)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/xmlhttprequest.rs')
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 99d412ee8b7..5044feae3b7 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -1129,12 +1129,17 @@ trait Extractable { fn extract(&self) -> Vec<u8>; } impl Extractable for SendParam { + // https://fetch.spec.whatwg.org/#concept-bodyinit-extract fn extract(&self) -> Vec<u8> { - // https://fetch.spec.whatwg.org/#concept-fetchbodyinit-extract - let encoding = UTF_8 as EncodingRef; match *self { - eString(ref s) => encoding.encode(s, EncoderTrap::Replace).unwrap(), - eURLSearchParams(ref usp) => usp.root().r().serialize(None) // Default encoding is UTF8 + eString(ref s) => { + let encoding = UTF_8 as EncodingRef; + encoding.encode(s, EncoderTrap::Replace).unwrap() + }, + eURLSearchParams(ref usp) => { + // Default encoding is UTF-8. + usp.root().r().serialize(None).as_bytes().to_owned() + }, } } } |