From 06946347f8252cdcca3a0bc9316f40832f14ad7d Mon Sep 17 00:00:00 2001 From: Avery Harnish Date: Tue, 3 Mar 2020 09:31:53 -0600 Subject: [PATCH] [dev] fix: properly route to new preview id after reload --- src/commands/dev/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/dev/mod.rs b/src/commands/dev/mod.rs index 838e13627..275b99f69 100644 --- a/src/commands/dev/mod.rs +++ b/src/commands/dev/mod.rs @@ -97,13 +97,13 @@ async fn serve( // create a closure that hyper will use later to handle HTTP requests let make_service = make_service_fn(move |_| { let client = client.to_owned(); - let preview_id = preview_id.lock().unwrap().to_owned(); let server_config = server_config.to_owned(); + let preview_id = preview_id.to_owned(); async move { Ok::<_, failure::Error>(service_fn(move |req| { let client = client.to_owned(); - let preview_id = preview_id.to_owned(); let server_config = server_config.to_owned(); + let preview_id = preview_id.lock().unwrap().to_owned(); let version = req.version(); let (parts, body) = req.into_parts(); let req_method = parts.method.to_string();