summaryrefslogtreecommitdiff
path: root/angelsharkd
diff options
context:
space:
mode:
Diffstat (limited to 'angelsharkd')
-rw-r--r--angelsharkd/src/config.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/angelsharkd/src/config.rs b/angelsharkd/src/config.rs
index b0866be..d7d18d2 100644
--- a/angelsharkd/src/config.rs
+++ b/angelsharkd/src/config.rs
@@ -23,7 +23,13 @@ impl Config {
.unwrap_or_else(|_| Ok(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080)))
.with_context(|| "Failed to parse socket bind address.")?;
- let origin = env::var("ANGELSHARKD_ORIGIN").unwrap_or_default();
+ let origin = if debug_mode {
+ String::new()
+ } else {
+ env::var("ANGELSHARKD_ORIGIN").with_context(|| {
+ "In release mode, CORS origin cannot be blank. Set ANGELSHARKD_ORIGIN"
+ })?
+ };
let logins = if let Ok(path) = env::var("ANGELSHARKD_LOGINS") {
File::open(path)