Skip to content

Commit 0fd639a

Browse files
committed
fix: cors plugin default settings
1 parent 05ea53f commit 0fd639a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/plugins/cors.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,13 @@ fn add_cors_headers(cfg: &Config, origin: Option<HeaderValue>, resp: &mut Respon
312312
}
313313

314314
// Access-Control-Allow-Headers header
315-
if !cfg.headers.is_empty() {
315+
if cfg.headers.is_empty() {
316+
// Allow all request headers by default when none are explicitly configured.
317+
resp.headers_mut().insert(
318+
ACCESS_CONTROL_ALLOW_HEADERS,
319+
HeaderValue::from_static("*"),
320+
);
321+
} else {
316322
let h = cfg
317323
.headers
318324
.iter()

0 commit comments

Comments
 (0)