fix: pass unknown encoding in decompression layer (#5300)

fix: allow pass unknown in decompression layer
This commit is contained in:
shuiyisong
2025-01-06 17:10:56 +08:00
committed by GitHub
parent 6a1ec8db25
commit a56c430db0
2 changed files with 12 additions and 4 deletions

View File

@@ -747,7 +747,7 @@ impl HttpServer {
.layer( .layer(
ServiceBuilder::new() ServiceBuilder::new()
.layer(HandleErrorLayer::new(handle_error)) .layer(HandleErrorLayer::new(handle_error))
.layer(RequestDecompressionLayer::new()), .layer(RequestDecompressionLayer::new().pass_through_unaccepted(true)),
) )
.with_state(log_state) .with_state(log_state)
} }
@@ -767,7 +767,7 @@ impl HttpServer {
.layer( .layer(
ServiceBuilder::new() ServiceBuilder::new()
.layer(HandleErrorLayer::new(handle_error)) .layer(HandleErrorLayer::new(handle_error))
.layer(RequestDecompressionLayer::new()), .layer(RequestDecompressionLayer::new().pass_through_unaccepted(true)),
) )
.with_state(log_state) .with_state(log_state)
} }
@@ -860,7 +860,7 @@ impl HttpServer {
.layer( .layer(
ServiceBuilder::new() ServiceBuilder::new()
.layer(HandleErrorLayer::new(handle_error)) .layer(HandleErrorLayer::new(handle_error))
.layer(RequestDecompressionLayer::new()), .layer(RequestDecompressionLayer::new().pass_through_unaccepted(true)),
) )
.route("/ping", routing::get(influxdb_ping)) .route("/ping", routing::get(influxdb_ping))
.route("/health", routing::get(influxdb_health)) .route("/health", routing::get(influxdb_health))
@@ -881,7 +881,7 @@ impl HttpServer {
.layer( .layer(
ServiceBuilder::new() ServiceBuilder::new()
.layer(HandleErrorLayer::new(handle_error)) .layer(HandleErrorLayer::new(handle_error))
.layer(RequestDecompressionLayer::new()), .layer(RequestDecompressionLayer::new().pass_through_unaccepted(true)),
) )
.with_state(otlp_handler) .with_state(otlp_handler)
} }

View File

@@ -1898,6 +1898,14 @@ pub async fn test_loki_pb_logs(store_type: StorageType) {
HeaderName::from_static("content-type"), HeaderName::from_static("content-type"),
HeaderValue::from_static("application/x-protobuf"), HeaderValue::from_static("application/x-protobuf"),
), ),
(
HeaderName::from_static("content-encoding"),
HeaderValue::from_static("snappy"),
),
(
HeaderName::from_static("accept-encoding"),
HeaderValue::from_static("identity"),
),
( (
HeaderName::from_static(GREPTIME_LOG_TABLE_NAME_HEADER_NAME), HeaderName::from_static(GREPTIME_LOG_TABLE_NAME_HEADER_NAME),
HeaderValue::from_static("loki_table_name"), HeaderValue::from_static("loki_table_name"),