From 26a3715f62751b8b89e62ce7e8db94a222bb7db0 Mon Sep 17 00:00:00 2001 From: llde Date: Fri, 10 Dec 2021 18:00:14 +0100 Subject: [PATCH] Revert move of variable --- src/unit.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/unit.rs b/src/unit.rs index 7bddac2..cb683c6 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -378,16 +378,16 @@ fn send_prelude(unit: &Unit, stream: &mut Stream, previous: &[String]) -> io::Re unit.url.query().unwrap_or_default(), )?; - let scheme_default: u16 = match unit.url.scheme() { - "http" => 80, - "https" => 443, - _ => 0, - }; // host header if not set by user. if !header::has_header(&unit.headers, "host") { let host = unit.url.host().unwrap(); match unit.url.port() { Some(port) => { + let scheme_default: u16 = match unit.url.scheme() { + "http" => 80, + "https" => 443, + _ => 0, + }; if scheme_default != 0 && scheme_default == port { prelude.write_header("Host", host)?; } else {