mirror of
https://github.com/actix/actix-extras.git
synced 2025-02-02 10:59:03 +01:00
Merge pull request #20 from JohnTitor/cors
Release `actix-cors` v0.3.0-alpha.1
This commit is contained in:
commit
62cf9baa51
@ -1,5 +1,10 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.3.0-alpha.1] - 2020-03-11
|
||||||
|
|
||||||
|
* Minimize `futures-*` dependencies
|
||||||
|
* Update `actix-web` dependency to 3.0.0-alpha.1
|
||||||
|
|
||||||
## [0.2.0] - 2019-12-20
|
## [0.2.0] - 2019-12-20
|
||||||
|
|
||||||
* Release
|
* Release
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-cors"
|
name = "actix-cors"
|
||||||
version = "0.2.0"
|
version = "0.3.0-alpha.1"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Cross-origin resource sharing (CORS) for actix-web applications."
|
description = "Cross-origin resource sharing (CORS) for actix-web applications."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@ -16,10 +16,10 @@ name = "actix_cors"
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "2.0.0"
|
actix-web = "3.0.0-alpha.1"
|
||||||
actix-service = "1.0.1"
|
actix-service = "1.0.1"
|
||||||
derive_more = "0.99.2"
|
derive_more = "0.99.2"
|
||||||
futures = "0.3.1"
|
futures-util = { version = "0.3.4", default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "1.0.0"
|
actix-rt = "1.0.0"
|
||||||
|
@ -52,7 +52,7 @@ use actix_web::http::header::{self, HeaderName, HeaderValue};
|
|||||||
use actix_web::http::{self, Error as HttpError, Method, StatusCode, Uri};
|
use actix_web::http::{self, Error as HttpError, Method, StatusCode, Uri};
|
||||||
use actix_web::HttpResponse;
|
use actix_web::HttpResponse;
|
||||||
use derive_more::Display;
|
use derive_more::Display;
|
||||||
use futures::future::{ok, Either, FutureExt, LocalBoxFuture, Ready};
|
use futures_util::future::{ok, Either, FutureExt, LocalBoxFuture, Ready};
|
||||||
|
|
||||||
/// A set of errors that can occur during processing CORS
|
/// A set of errors that can occur during processing CORS
|
||||||
#[derive(Debug, Display)]
|
#[derive(Debug, Display)]
|
||||||
@ -776,10 +776,8 @@ where
|
|||||||
if let Some(origin) =
|
if let Some(origin) =
|
||||||
inner.access_control_allow_origin(res.request().head())
|
inner.access_control_allow_origin(res.request().head())
|
||||||
{
|
{
|
||||||
res.headers_mut().insert(
|
res.headers_mut()
|
||||||
header::ACCESS_CONTROL_ALLOW_ORIGIN,
|
.insert(header::ACCESS_CONTROL_ALLOW_ORIGIN, origin);
|
||||||
origin,
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(ref expose) = inner.expose_hdrs {
|
if let Some(ref expose) = inner.expose_hdrs {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user