mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #29640 - CYBAI:fix-response-empty-init, r=mrobinson
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. With this PR, we can fix the TIMEOUT in `/fetch/content-type/response.window.html` so I think it should fix #22304. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22304 - [x] There are tests for these changes
This commit is contained in:
commit
8a779b84d7
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