mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix cors (#2749)
This commit is contained in:
@@ -84,7 +84,7 @@ pub fn rpc_router<C: Context + Clone + AsRef<RpcContinuations>>(
|
||||
server: HttpServer<C>,
|
||||
) -> Router {
|
||||
Router::new()
|
||||
.route("/rpc/*path", post(server))
|
||||
.route("/rpc/*path", any(server))
|
||||
.route(
|
||||
"/ws/rpc/:guid",
|
||||
get({
|
||||
|
||||
@@ -98,11 +98,11 @@ pub fn registry_api<C: Context>() -> ParentHandler<C> {
|
||||
|
||||
pub fn registry_router(ctx: RegistryContext) -> Router {
|
||||
use axum::extract as x;
|
||||
use axum::routing::{any, get, post};
|
||||
use axum::routing::{any, get};
|
||||
Router::new()
|
||||
.route("/rpc/*path", {
|
||||
let ctx = ctx.clone();
|
||||
post(
|
||||
any(
|
||||
Server::new(move || ready(Ok(ctx.clone())), registry_api())
|
||||
.middleware(Cors::new())
|
||||
.middleware(Auth::new())
|
||||
|
||||
Reference in New Issue
Block a user