Fix cors_origin wildcard (fixes #4214) (#4221)

This commit is contained in:
Nutomic 2023-12-01 15:16:55 +01:00 committed by GitHub
parent 809fc05cb3
commit d7376d9541
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -326,7 +326,7 @@ fn cors_config(settings: &Settings) -> Cors {
(Some(origin), false) => {
// Need to call send_wildcard() explicitly, passing this into allowed_origin() results in error
if cors_origin_setting.as_deref() == Some("*") {
Cors::default().send_wildcard()
Cors::default().allow_any_origin().send_wildcard()
} else {
Cors::default()
.allowed_origin(&origin)