Skip to content

Commit

Permalink
Add actix-http support for actix error messages (#1379)
Browse files Browse the repository at this point in the history
* Moved actix-http for actix from actix crate

* remove resolver feature

* renamed actix feature to actor

* fixed doc attr for actors, add documentation
  • Loading branch information
dunnock authored Feb 27, 2020
1 parent 71c4bd1 commit 48ef4d7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Setting a cookie's SameSite property, explicitly, to `SameSite::None` will now
result in `SameSite=None` being sent with the response Set-Cookie header.
To create a cookie without a SameSite attribute, remove any calls setting same_site.
* actix-http support for Actors messages was moved to actix-http crate and is enabled
with feature `actors`

## 2.0.0

Expand Down
2 changes: 2 additions & 0 deletions actix-http/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

* Update the `time` dependency to 0.2.7

* Moved actors messages support from actix crate, enabled with feature `actors`.

### Fixed

* Allow `SameSite=None` cookies to be sent in a response.
Expand Down
6 changes: 5 additions & 1 deletion actix-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license = "MIT/Apache-2.0"
edition = "2018"

[package.metadata.docs.rs]
features = ["openssl", "rustls", "failure", "compress", "secure-cookies"]
features = ["openssl", "rustls", "failure", "compress", "secure-cookies","actors"]

[lib]
name = "actix_http"
Expand All @@ -39,6 +39,9 @@ failure = ["fail-ure"]
# support for secure cookies
secure-cookies = ["ring"]

# support for actix Actor messages
actors = ["actix"]

[dependencies]
actix-service = "1.0.1"
actix-codec = "0.2.0"
Expand All @@ -47,6 +50,7 @@ actix-utils = "1.0.3"
actix-rt = "1.0.0"
actix-threadpool = "0.3.1"
actix-tls = { version = "1.0.0", optional = true }
actix = { version = "0.10.0-alpha.1", optional = true }

base64 = "0.11"
bitflags = "1.2"
Expand Down
10 changes: 10 additions & 0 deletions actix-http/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,16 @@ where
/// Compatibility for `failure::Error`
impl ResponseError for fail_ure::Error {}

#[cfg(feature = "actors")]
/// `InternalServerError` for `actix::MailboxError`
/// This is supported on feature=`actors` only
impl ResponseError for actix::MailboxError {}

#[cfg(feature = "actors")]
/// `InternalServerError` for `actix::ResolverError`
/// This is supported on feature=`actors` only
impl ResponseError for actix::actors::resolver::ResolverError {}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 48ef4d7

Please sign in to comment.