Skip to content

Commit d34d394

Browse files
TuntiiCopilot
andauthored
Update crates/rustapi-extras/src/cors/mod.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9424fac commit d34d394

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • crates/rustapi-extras/src/cors

crates/rustapi-extras/src/cors/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl MiddlewareLayer for CorsLayer {
195195
) -> Pin<Box<dyn Future<Output = Response> + Send + 'static>> {
196196
let origins = self.origins.clone();
197197
let methods = self.methods_header_value();
198-
let allow_headers = if self.headers.iter().any(|value| value == "*") {
198+
let allow_headers = if self.headers.len() == 1 && self.headers.first().map(|value| value == "*").unwrap_or(false) {
199199
req.headers()
200200
.get(header::ACCESS_CONTROL_REQUEST_HEADERS)
201201
.and_then(|value| value.to_str().ok())

0 commit comments

Comments
 (0)