index : static-web-server.git

ascending towards madness

author Jose Quintana <joseluisquintana20@gmail.com> 2021-02-08 20:25:07.0 +00:00:00
committer Jose Quintana <joseluisquintana20@gmail.com> 2021-02-08 20:25:07.0 +00:00:00
commit
4fe89c5d91c2eda8bda7d0457e8f3ebaff039809 [patch]
tree
e8a863de1408dc8ea1d446883703c73647dd29b6
parent
e71af1584ba330ffd85b3e6f0b89b253445fd086
download
4fe89c5d91c2eda8bda7d0457e8f3ebaff039809.tar.gz

refactor: trim comma-separated cors allow hosts



Diff

 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::<HashSet<_>>();
                chain.link_around(CorsMiddleware::with_whitelist(allowed_hosts));
            };