From 19758f902c84e5aa1c468e0f1b191cde564711a3 Mon Sep 17 00:00:00 2001 From: OlivierDehaene <23298448+OlivierDehaene@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:05:34 +0100 Subject: [PATCH] docs --- router/src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/router/src/main.rs b/router/src/main.rs index 4dd4cc73..f1cf09a0 100644 --- a/router/src/main.rs +++ b/router/src/main.rs @@ -1,5 +1,5 @@ -use axum::http::HeaderValue; /// Text Generation Inference webserver entrypoint +use axum::http::HeaderValue; use clap::Parser; use opentelemetry::sdk::propagation::TraceContextPropagator; use opentelemetry::sdk::trace; @@ -73,9 +73,11 @@ fn main() -> Result<(), std::io::Error> { } // CORS allowed origins - let cors_allow_origin: Option = cors_allow_origin.map(|cors_value_origin| { + // map to go inside the option and then map to parse from String to HeaderValue + // Finally, convert to AllowOrigin + let cors_allow_origin: Option = cors_allow_origin.map(|cors_allow_origin| { AllowOrigin::list( - cors_value_origin + cors_allow_origin .iter() .map(|origin| origin.parse::().unwrap()), )