From 2ebcc729ac791f05acf8f011494a26ce59a0f7ff Mon Sep 17 00:00:00 2001 From: "Carpenter, Adam (CORP)" Date: Thu, 14 Oct 2021 10:52:57 -0400 Subject: feat: allow any origin when ANGELSHARKD_ORIGIN is * --- CHANGELOG | 3 ++- Cargo.lock | 2 +- angelsharkd/Cargo.toml | 2 +- angelsharkd/src/main.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6f4dde5..639fbf0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1 +1,2 @@ -0.1.0: Initial release. \ No newline at end of file +0.1.0: Initial release. +0.1.1: ANGELSHARKD_ORIGIN accepts '*' to allow any origin. \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 54a14bb..ed91cff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,7 +24,7 @@ dependencies = [ [[package]] name = "angelsharkd" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "env_logger", diff --git a/angelsharkd/Cargo.toml b/angelsharkd/Cargo.toml index 9a5c750..e855789 100644 --- a/angelsharkd/Cargo.toml +++ b/angelsharkd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "angelsharkd" -version = "0.1.0" +version = "0.1.1" edition = "2018" authors = ["Adam T. Carpenter "] description = "A HTTP interface into one or more Communication Managers" diff --git a/angelsharkd/src/main.rs b/angelsharkd/src/main.rs index 22e4161..8a8a53e 100644 --- a/angelsharkd/src/main.rs +++ b/angelsharkd/src/main.rs @@ -30,7 +30,7 @@ async fn main() -> Result<()> { let routes = routes::index() .or(routes::ossi(&config)) - .with(if config.debug_mode { + .with(if config.debug_mode || config.origin == "*" { warp::cors() .allow_any_origin() .allow_methods(&[Method::GET, Method::POST]) -- cgit v1.2.3