diff options
author | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2022-02-06 10:12:19 +0000 |
---|---|---|
committer | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2022-02-06 10:12:19 +0000 |
commit | 8e0930cc9f25e44a69f61763ac5ff38ba58bb3dd (patch) | |
tree | e9500f4d2180984fe7981205c44ac89048f1019c /src/main.rs | |
parent | Merge pull request #725 from aliemjay/update_actix_web (diff) | |
parent | Apply alimjays suggestion (diff) | |
download | miniserve-8e0930cc9f25e44a69f61763ac5ff38ba58bb3dd.tar.gz miniserve-8e0930cc9f25e44a69f61763ac5ff38ba58bb3dd.zip |
Merge 'jikstra/feat_route_prefix' #682
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index 7f1944f..732abac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -165,10 +165,7 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), ContextualError> { Some(_) => format!("https://{}", addr), None => format!("http://{}", addr), }) - .map(|url| match miniserve_config.random_route { - Some(ref random_route) => format!("{}/{}", url, random_route), - None => url, - }) + .map(|url| format!("{}{}", url, miniserve_config.route_prefix)) .collect::<Vec<_>>() }; @@ -195,7 +192,7 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), ContextualError> { ) .route(&format!("/{}", inside_config.css_route), web::get().to(css)) .service( - web::scope(inside_config.random_route.as_deref().unwrap_or("")) + web::scope(&inside_config.route_prefix) .wrap(middleware::Condition::new( !inside_config.auth.is_empty(), actix_web::middleware::Compat::new(HttpAuthentication::basic( |