From 4fe89c5d91c2eda8bda7d0457e8f3ebaff039809 Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Mon, 8 Feb 2021 21:25:07 +0100 Subject: [PATCH] refactor: trim comma-separated cors allow hosts --- src/staticfiles.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/staticfiles.rs b/src/staticfiles.rs index 07de16f..1db2b0c 100644 --- a/src/staticfiles.rs +++ b/src/staticfiles.rs @@ -80,7 +80,7 @@ impl StaticFiles { } else { let allowed_hosts = allowed_hosts .split(',') - .map(|s| s.to_string()) + .map(|s| s.trim().to_string()) .collect::>(); chain.link_around(CorsMiddleware::with_whitelist(allowed_hosts)); }; -- libgit2 1.7.2