mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
Merge pull request #194 from actix/brandur-allowed-origin-into
Let CSRF's `allowed_origin()` be specified as a type supporting `Into<String>`
This commit is contained in:
commit
f89b7a9bb8
@ -150,8 +150,8 @@ impl CsrfFilter {
|
|||||||
|
|
||||||
/// Add an origin that is allowed to make requests. Will be verified
|
/// Add an origin that is allowed to make requests. Will be verified
|
||||||
/// against the `Origin` request header.
|
/// against the `Origin` request header.
|
||||||
pub fn allowed_origin(mut self, origin: &str) -> CsrfFilter {
|
pub fn allowed_origin<T: Into<String>>(mut self, origin: T) -> CsrfFilter {
|
||||||
self.origins.insert(origin.to_owned());
|
self.origins.insert(origin.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user