mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +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>,
|
server: HttpServer<C>,
|
||||||
) -> Router {
|
) -> Router {
|
||||||
Router::new()
|
Router::new()
|
||||||
.route("/rpc/*path", post(server))
|
.route("/rpc/*path", any(server))
|
||||||
.route(
|
.route(
|
||||||
"/ws/rpc/:guid",
|
"/ws/rpc/:guid",
|
||||||
get({
|
get({
|
||||||
|
|||||||
@@ -98,11 +98,11 @@ pub fn registry_api<C: Context>() -> ParentHandler<C> {
|
|||||||
|
|
||||||
pub fn registry_router(ctx: RegistryContext) -> Router {
|
pub fn registry_router(ctx: RegistryContext) -> Router {
|
||||||
use axum::extract as x;
|
use axum::extract as x;
|
||||||
use axum::routing::{any, get, post};
|
use axum::routing::{any, get};
|
||||||
Router::new()
|
Router::new()
|
||||||
.route("/rpc/*path", {
|
.route("/rpc/*path", {
|
||||||
let ctx = ctx.clone();
|
let ctx = ctx.clone();
|
||||||
post(
|
any(
|
||||||
Server::new(move || ready(Ok(ctx.clone())), registry_api())
|
Server::new(move || ready(Ok(ctx.clone())), registry_api())
|
||||||
.middleware(Cors::new())
|
.middleware(Cors::new())
|
||||||
.middleware(Auth::new())
|
.middleware(Auth::new())
|
||||||
|
|||||||
Reference in New Issue
Block a user