From f42574fa67a718fcccdff136103d8b5869b5acd2 Mon Sep 17 00:00:00 2001 From: shenghui Date: Sat, 18 May 2024 16:56:09 +0800 Subject: [PATCH] Update middleware --- api/src/middleware/cors.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/middleware/cors.rs b/api/src/middleware/cors.rs index 3818175..85a1e87 100644 --- a/api/src/middleware/cors.rs +++ b/api/src/middleware/cors.rs @@ -23,8 +23,12 @@ pub async fn handle(request: Request, next: Next) -> Response { ); cors_headers.insert( ACCESS_CONTROL_ALLOW_HEADERS, - HeaderValue::from_static("content-type, authorization, withCredentials"), + HeaderValue::from_static("Content-Type, Authorization, withCredentials"), ); + // cors_headers.insert( + // ACCESS_CONTROL_EXPOSE_HEADERS, + // HeaderValue::from_static("服务器暴露一些自定义的头信息,允许客户端访问"), + // ); if request.method() == Method::OPTIONS { return (StatusCode::NO_CONTENT, cors_headers).into_response();