mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Reset to in-memory stream with empty byte sequence for None init body
Because the response body stream is initialized with FetchResponse, it cannot be processed with in-memory empty sequence. Thus, instead of using the FetchResponse stream, we'll reset it to Memory body stream with empty byte sequence if there's no init body.
This commit is contained in:
parent
7eca93bb7a
commit
7c9c786053
8 changed files with 109 additions and 984 deletions
|
@ -144,6 +144,11 @@ impl Response {
|
|||
)?;
|
||||
}
|
||||
};
|
||||
} else {
|
||||
// Reset FetchResponse to an in-memory stream with empty byte sequence here for
|
||||
// no-init-body case
|
||||
let stream = ReadableStream::new_from_bytes(&global, Vec::with_capacity(0));
|
||||
r.body_stream.set(Some(&*stream));
|
||||
}
|
||||
|
||||
Ok(r)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue