diff --git a/Cargo.lock b/Cargo.lock index e5e4251..a02d8a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1057,7 +1057,7 @@ dependencies = [ [[package]] name = "daemon" -version = "1.0.2" +version = "1.0.3" dependencies = [ "anyhow", "arrow", @@ -2287,7 +2287,7 @@ dependencies = [ [[package]] name = "oracle" -version = "1.0.2" +version = "1.0.3" dependencies = [ "anyhow", "axum", diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index cedd2dc..ff1fbde 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daemon" -version = "1.0.2" +version = "1.0.3" edition = "2021" repository = "https://github.com/tee8z/noaa-data-pipeline" diff --git a/oracle/Cargo.toml b/oracle/Cargo.toml index 06e3d75..bdcbc43 100644 --- a/oracle/Cargo.toml +++ b/oracle/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oracle" -version = "1.0.2" +version = "1.0.3" edition = "2021" repository = "https://github.com/tee8z/noaa-data-pipeline" diff --git a/oracle/src/startup.rs b/oracle/src/startup.rs index 37d84da..da0a993 100644 --- a/oracle/src/startup.rs +++ b/oracle/src/startup.rs @@ -15,7 +15,7 @@ use axum::{ routing::{get, post}, Router, }; -use hyper::Method; +use hyper::{Method, header::{ACCEPT, CONTENT_TYPE}}; use log::info; use std::sync::Arc; use tower_http::{ @@ -103,7 +103,8 @@ pub fn app(app_state: AppState) -> Router { let serve_dir = ServeDir::new("ui").not_found_service(ServeFile::new(app_state.ui_dir.clone())); let cors = CorsLayer::new() // allow `GET` and `POST` when accessing the resource - .allow_methods([Method::GET, Method::POST]) + .allow_methods([Method::GET, Method::POST, Method::OPTIONS]) + .allow_headers([ACCEPT,CONTENT_TYPE]) // allow requests from any origin .allow_origin(Any); Router::new()