Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit fcf220e

Browse files
bors[bot]Franck Royer
andauthored
Merge #222
222: Simplify Cors setting representation r=mergify[bot] a=D4nte Follow-up of #221 Co-authored-by: Franck Royer <franck@coblox.tech>
2 parents 7a4400c + 5efe84b commit fcf220e

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

src/cnd_settings.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,7 @@ pub struct Socket {
3535

3636
#[derive(Clone, Debug, Serialize)]
3737
pub struct Cors {
38-
pub allowed_origins: AllowedOrigins,
39-
}
40-
41-
#[derive(Clone, Debug, Serialize)]
42-
#[serde(untagged)]
43-
pub enum AllowedOrigins {
44-
All(All),
45-
None(None),
46-
Some(Vec<String>),
47-
}
48-
49-
#[derive(Clone, Debug, Serialize)]
50-
#[serde(rename_all = "lowercase")]
51-
pub enum All {
52-
All,
53-
}
54-
55-
#[derive(Clone, Debug, Serialize)]
56-
#[serde(rename_all = "lowercase")]
57-
pub enum None {
58-
None,
38+
pub allowed_origins: String,
5939
}
6040

6141
#[derive(Clone, Debug, Serialize)]
@@ -114,7 +94,7 @@ impl Default for Socket {
11494
impl Default for Cors {
11595
fn default() -> Cors {
11696
Cors {
117-
allowed_origins: AllowedOrigins::All(All::All),
97+
allowed_origins: String::from("all"),
11898
}
11999
}
120100
}

0 commit comments

Comments
 (0)