net: Refactor Decoder (#33611)

* Refactor Decoder to be fully async

Signed-off-by: crbrz <cristianb@gmail.com>

* Update WPT results

Signed-off-by: crbrz <cristianb@gmail.com>

* Fix deflate unit test

Signed-off-by: crbrz <cristianb@gmail.com>

* Add compressed response update count test

Signed-off-by: crbrz <cristianb@gmail.com>

* Fix typo

Signed-off-by: crbrz <cristianb@gmail.com>

* Source error check without conversion to String

Signed-off-by: crbrz <cristianb@gmail.com>

* Simplify error check

Signed-off-by: crbrz <cristianb@gmail.com>

* Fix variable name

Signed-off-by: crbrz <cristianb@gmail.com>

* Added TODO note for network.tls.ignore_unexpected_eof

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
This commit is contained in:
Cristian Brinza 2024-10-02 19:59:31 +03:00 committed by GitHub
parent c682172440
commit c7a4e4f627
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 278 additions and 457 deletions

View file

@ -648,6 +648,7 @@ async fn obtain_response(
let host = request.uri().host().unwrap_or("").to_owned();
let override_manager = context.state.override_manager.clone();
let headers = headers.clone();
let is_secure_scheme = url.is_secure_scheme();
client
.request(request)
@ -681,7 +682,7 @@ async fn obtain_response(
debug!("Not notifying devtools (no request_id)");
None
};
future::ready(Ok((Decoder::detect(res), msg)))
future::ready(Ok((Decoder::detect(res, is_secure_scheme), msg)))
})
.map_err(move |error| {
NetworkError::from_hyper_error(