diff options
author | Carpenter, Adam (CORP) <Adam.Carpenter@adp.com> | 2021-10-14 10:52:57 -0400 |
---|---|---|
committer | Carpenter, Adam (CORP) <Adam.Carpenter@adp.com> | 2021-10-14 10:52:57 -0400 |
commit | 2ebcc729ac791f05acf8f011494a26ce59a0f7ff (patch) | |
tree | 95a24e4a29cfc0578ea45fe83b9200d2de5ea6fc | |
parent | f285fea69104de6952b96679b9de22d5bf9ffdb1 (diff) | |
download | altruistic-angelshark-2ebcc729ac791f05acf8f011494a26ce59a0f7ff.tar.xz altruistic-angelshark-2ebcc729ac791f05acf8f011494a26ce59a0f7ff.zip |
feat: allow any origin when ANGELSHARKD_ORIGIN is *
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | angelsharkd/Cargo.toml | 2 | ||||
-rw-r--r-- | angelsharkd/src/main.rs | 2 |
4 files changed, 5 insertions, 4 deletions
@@ -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 @@ -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 <adam.carpenter@adp.com>"] 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]) |