1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 10:27:42 +02:00

fix expose all headers (#273)

* fix expose all headers

* update changelog
This commit is contained in:
Rob Ede
2022-08-07 21:56:33 +02:00
committed by GitHub
parent bcb8dbe1fc
commit 7c3c9357e0
5 changed files with 21 additions and 14 deletions

View File

@ -315,7 +315,7 @@ impl Cors {
self
}
/// Resets exposed response header list to a state where any header is accepted.
/// Resets exposed response header list to a state where all headers are exposed.
///
/// See [`Cors::expose_headers`] for more info on exposed response headers.
pub fn expose_any_header(mut self) -> Cors {

View File

@ -121,10 +121,9 @@ impl<S> CorsMiddleware<S> {
.insert(header::ACCESS_CONTROL_EXPOSE_HEADERS, expose.clone());
} else if matches!(inner.expose_headers, AllOrSome::All) {
// intersperse_header_values requires that argument is non-empty
if !res.request().headers().is_empty() {
if !res.headers().is_empty() {
// extract header names from request
let expose_all_request_headers = res
.request()
.headers()
.keys()
.into_iter()