diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-09-29 17:52:41 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-09-29 17:52:44 +0200 |
commit | e72b5613ee1c65233f85bac84371a822f8c2d30b (patch) | |
tree | f2bfd39d7de2ebf3476b1b4bd5fe5a5b89bf27f1 /components/script/dom | |
parent | 760f28b551ac25dbd60a0abf822cebf3ff1287a1 (diff) | |
download | servo-e72b5613ee1c65233f85bac84371a822f8c2d30b.tar.gz servo-e72b5613ee1c65233f85bac84371a822f8c2d30b.zip |
Don't move the data when extracting the bytes in XMLHttpRequest::Send.
The data is used later to set the Content-Type header. Current rustc
(4d2af3861) does not detect this use-after-move, but treats the later use as
if the data was None. It will, however, detect the bug in d2b30f7d3, which we
are upgrading to.
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 4f310a8948b..49a8b861338 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -450,7 +450,7 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> { Get | Head => None, // Step 3 _ => data }; - let extracted = data.map(|d| d.extract()); + let extracted = data.as_ref().map(|d| d.extract()); self.request_body_len.set(extracted.as_ref().map(|e| e.len()).unwrap_or(0)); // Step 6 |