1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-30 21:41:27 +00: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:
Brandur 2018-04-21 10:37:18 -07:00 committed by GitHub
commit f89b7a9bb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,8 +150,8 @@ impl CsrfFilter {
/// Add an origin that is allowed to make requests. Will be verified
/// against the `Origin` request header.
pub fn allowed_origin(mut self, origin: &str) -> CsrfFilter {
self.origins.insert(origin.to_owned());
pub fn allowed_origin<T: Into<String>>(mut self, origin: T) -> CsrfFilter {
self.origins.insert(origin.into());
self
}