1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-20 04:35:38 +02:00

complete cors implementation

This commit is contained in:
Nikolay Kim
2018-01-10 13:41:33 -08:00
parent 3f3dcf413b
commit 615db0d9d8
2 changed files with 295 additions and 19 deletions

View File

@@ -396,7 +396,7 @@ impl HttpResponseBuilder {
/// This method calls provided closure with builder reference if value is true.
pub fn if_true<F>(&mut self, value: bool, f: F) -> &mut Self
where F: Fn(&mut HttpResponseBuilder) + 'static
where F: FnOnce(&mut HttpResponseBuilder)
{
if value {
f(self);
@@ -406,7 +406,7 @@ impl HttpResponseBuilder {
/// This method calls provided closure with builder reference if value is Some.
pub fn if_some<T, F>(&mut self, value: Option<&T>, f: F) -> &mut Self
where F: Fn(&T, &mut HttpResponseBuilder) + 'static
where F: FnOnce(&T, &mut HttpResponseBuilder)
{
if let Some(val) = value {
f(val, self);