diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 79a1bb624b..6a900eb8ea 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -307,7 +307,7 @@ pub struct HttpStreamResource { conn: Rc, pub rd: AsyncRefCell, wr: AsyncRefCell, - accept_encoding: RefCell, + accept_encoding: Encoding, cancel_handle: CancelHandle, } @@ -322,7 +322,7 @@ impl HttpStreamResource { conn: conn.clone(), rd: HttpRequestReader::Headers(request).into(), wr: HttpResponseWriter::Headers(response_tx).into(), - accept_encoding: RefCell::new(accept_encoding), + accept_encoding, cancel_handle: CancelHandle::new(), } } @@ -491,7 +491,7 @@ async fn op_http_write_headers( .get::(rid)?; // Track supported encoding - let encoding = *stream.accept_encoding.borrow(); + let encoding = stream.accept_encoding; let mut builder = Response::builder(); // SAFETY: can not fail, since a fresh Builder is non-errored