fix: Br is too slow, removed from encoding (#2197)

This commit is contained in:
J H
2023-03-09 15:37:41 -07:00
committed by GitHub
parent 52d3c4d62d
commit 8ffcd9b60a

View File

@@ -429,7 +429,7 @@ async fn file_send(
let mut builder = Response::builder().status(StatusCode::OK); let mut builder = Response::builder().status(StatusCode::OK);
builder = with_e_tag(path, &metadata, builder)?; builder = with_e_tag(path, &metadata, builder)?;
builder = with_content_type(path, builder); builder = with_content_type(path, builder);
let body = if accept_encoding.contains(&"br") && metadata.len() > u16::MAX as u64 { let body = if false && accept_encoding.contains(&"br") && metadata.len() > u16::MAX as u64 {
builder = builder.header(CONTENT_ENCODING, "br"); builder = builder.header(CONTENT_ENCODING, "br");
Body::wrap_stream(ReaderStream::new(BrotliEncoder::new(BufReader::new(file)))) Body::wrap_stream(ReaderStream::new(BrotliEncoder::new(BufReader::new(file))))
} else if accept_encoding.contains(&"gzip") && metadata.len() > u16::MAX as u64 { } else if accept_encoding.contains(&"gzip") && metadata.len() > u16::MAX as u64 {