You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #29640, I've noticed that we're initializing Response with ExternalUnderlyingSource::FetchResponse by default. However, in most cases, when Response constructor is used from JS, it should always use InMemory external underlying source instead, even it doesn't have a body. Also, FetchResponse should only be used by the browser engine itself when it's used by fetch.
let stream = ReadableStream::new_with_external_underlying_source(
global,
ExternalUnderlyingSource::FetchResponse,
);
Response{
Thus, it would be better to initialize the Response::new with InMemory by default and we should export another method to initialize Response with FetchResponse for fetch.
We can start to work on this when #29640 is merged.
The text was updated successfully, but these errors were encountered:
While working on #29640, I've noticed that we're initializing
Response
withExternalUnderlyingSource::FetchResponse
by default. However, in most cases, whenResponse
constructor is used from JS, it should always useInMemory
external underlying source instead, even it doesn't have a body. Also,FetchResponse
should only be used by the browser engine itself when it's used byfetch
.servo/components/script/dom/response.rs
Lines 56 to 61 in 98bae01
Thus, it would be better to initialize the
Response::new
withInMemory
by default and we should export another method to initializeResponse
withFetchResponse
forfetch
.We can start to work on this when #29640 is merged.
The text was updated successfully, but these errors were encountered: