Skip to content

Commit

Permalink
Update middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
shenghui0779 committed May 18, 2024
1 parent 284ea66 commit f42574f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/src/middleware/cors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f42574f

Please sign in to comment.