mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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.
This commit is contained in:
parent
760f28b551
commit
e72b5613ee
4 changed files with 1 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue