Skip to content

Commit

Permalink
Solving indexing regression
Browse files Browse the repository at this point in the history
It was caused by the output compression.

Closes #5049
  • Loading branch information
fulmicoton committed Jun 3, 2024
1 parent ac37d08 commit ccf4f47
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions quickwit/quickwit-serve/src/rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ use hyper::{http, Method, StatusCode};
use quickwit_common::tower::BoxFutureInfaillible;
use tower::make::Shared;
use tower::ServiceBuilder;
use tower_http::compression::predicate::{DefaultPredicate, Predicate, SizeAbove};
use tower_http::compression::CompressionLayer;
use tower_http::cors::CorsLayer;
use tracing::{error, info};
use warp::filters::log::Info;
Expand All @@ -52,10 +50,6 @@ use crate::template_api::index_template_api_handlers;
use crate::ui_handler::ui_handler;
use crate::{BodyFormat, BuildInfo, QuickwitServices, RuntimeInfo};

/// The minimum size a response body must be in order to
/// be automatically compressed with gzip.
const MINIMUM_RESPONSE_COMPRESSION_SIZE: u16 = 10 << 10;

#[derive(Debug)]
pub(crate) struct InvalidJsonRequest(pub serde_json::Error);

Expand Down Expand Up @@ -158,18 +152,9 @@ pub(crate) async fn start_rest_server(
.boxed();

let warp_service = warp::service(rest_routes);
let compression_predicate =
DefaultPredicate::new().and(SizeAbove::new(MINIMUM_RESPONSE_COMPRESSION_SIZE));
let cors = build_cors(&quickwit_services.node_config.rest_config.cors_allow_origins);

let service = ServiceBuilder::new()
.layer(
CompressionLayer::new()
.gzip(true)
.compress_when(compression_predicate),
)
.layer(cors)
.service(warp_service);
let service = ServiceBuilder::new().layer(cors).service(warp_service);

info!(
rest_listen_addr=?rest_listen_addr,
Expand Down

0 comments on commit ccf4f47

Please sign in to comment.