From 0c04802560f16c3b11b545f7f538c28e413870f1 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:44:24 -0600 Subject: [PATCH] fix cors (#2749) --- core/startos/src/net/static_server.rs | 2 +- core/startos/src/registry/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/startos/src/net/static_server.rs b/core/startos/src/net/static_server.rs index f1da91851..c070d7920 100644 --- a/core/startos/src/net/static_server.rs +++ b/core/startos/src/net/static_server.rs @@ -84,7 +84,7 @@ pub fn rpc_router>( server: HttpServer, ) -> Router { Router::new() - .route("/rpc/*path", post(server)) + .route("/rpc/*path", any(server)) .route( "/ws/rpc/:guid", get({ diff --git a/core/startos/src/registry/mod.rs b/core/startos/src/registry/mod.rs index d34ebb841..529cb5082 100644 --- a/core/startos/src/registry/mod.rs +++ b/core/startos/src/registry/mod.rs @@ -98,11 +98,11 @@ pub fn registry_api() -> ParentHandler { 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())