mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-03-13 15:02:44 +00:00
parent
ba7d4bd117
commit
b92853824f
1 changed files with 4 additions and 1 deletions
|
@ -15,7 +15,10 @@ pub fn cors_config(settings: &Settings) -> Cors {
|
||||||
.expose_any_header()
|
.expose_any_header()
|
||||||
.max_age(3600);
|
.max_age(3600);
|
||||||
|
|
||||||
if cfg!(debug_assertions) || cors_origin_setting.contains(&"*".to_string()) {
|
if cfg!(debug_assertions)
|
||||||
|
|| cors_origin_setting.is_empty()
|
||||||
|
|| cors_origin_setting.contains(&"*".to_string())
|
||||||
|
{
|
||||||
cors = cors.allow_any_origin();
|
cors = cors.allow_any_origin();
|
||||||
} else {
|
} else {
|
||||||
cors = cors.allowed_origin(&self_origin);
|
cors = cors.allowed_origin(&self_origin);
|
||||||
|
|
Loading…
Reference in a new issue