mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
refactor(gateway): 将 CF 头剥离中间件下移至各 router 构建函数并重构为前缀匹配
This commit is contained in:
@@ -20,6 +20,7 @@ use thiserror::Error;
|
||||
use crate::execution_runtime::{
|
||||
build_direct_execution_frame_stream, DirectSyncExecutionRuntime, ExecutionRuntimeTransportError,
|
||||
};
|
||||
use crate::middleware;
|
||||
|
||||
const EXECUTION_RUNTIME_COMPONENT: &str = "aether-gateway-execution-runtime";
|
||||
const REQUEST_GATE_NAME: &str = "execution_runtime_requests";
|
||||
@@ -128,12 +129,14 @@ pub fn build_execution_runtime_router_with_request_gates(
|
||||
.with_distributed_request_gate(gate),
|
||||
None => ExecutionRuntimeAppState::with_request_concurrency_limit(limit),
|
||||
};
|
||||
Router::new()
|
||||
.route("/health", get(health))
|
||||
.route("/metrics", get(metrics))
|
||||
.route("/v1/execute/sync", post(execute_sync))
|
||||
.route("/v1/execute/stream", post(execute_stream))
|
||||
.with_state(state)
|
||||
middleware::apply_cf_header_stripping(
|
||||
Router::new()
|
||||
.route("/health", get(health))
|
||||
.route("/metrics", get(metrics))
|
||||
.route("/v1/execute/sync", post(execute_sync))
|
||||
.route("/v1/execute/stream", post(execute_stream))
|
||||
.with_state(state),
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn serve_execution_runtime_tcp(
|
||||
|
||||
Reference in New Issue
Block a user