allow auth & content-type in header for cors

This commit is contained in:
Ruben Fiszel
2023-08-21 02:23:31 +02:00
parent dd72b33136
commit 28a53a8eeb
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -46,6 +46,7 @@ use windmill_queue::{get_queued_job, push, QueueTransaction};
pub fn workspaced_service() -> Router {
let cors = CorsLayer::new()
.allow_methods([http::Method::GET, http::Method::POST])
.allow_headers([http::header::CONTENT_TYPE, http::header::AUTHORIZATION])
.allow_origin(Any);
Router::new()
+2 -1
View File
@@ -24,7 +24,7 @@ use axum::extract::DefaultBodyLimit;
use axum::{middleware::from_extractor, routing::get, Extension, Router};
use db::DB;
use git_version::git_version;
use hyper::Method;
use hyper::{http, Method};
use mail_send::SmtpClientBuilder;
use reqwest::Client;
use std::{net::SocketAddr, sync::Arc};
@@ -185,6 +185,7 @@ pub async fn run_server(
let cors = CorsLayer::new()
.allow_methods([Method::GET, Method::POST])
.allow_headers([http::header::CONTENT_TYPE, http::header::AUTHORIZATION])
.allow_origin(Any);
#[cfg(feature = "enterprise")]