Skip to content

Commit 4e5b50e

Browse files
committed
Set max duration for CORS on grpc server
1 parent edd5e78 commit 4e5b50e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

services/server/src/grpc/server.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ pub fn build_grpc_router(
6161
HeaderName::from_static("grpc-status"),
6262
HeaderName::from_static("grpc-message"),
6363
])
64-
.allow_methods([http::Method::POST, http::Method::OPTIONS]);
64+
.allow_methods([http::Method::POST, http::Method::OPTIONS])
65+
.max_age(std::time::Duration::from_secs(86400));
6566

6667
Ok(routes.into_axum_router().layer(cors))
6768
}

0 commit comments

Comments
 (0)