From 49ea36399de10495939d8be3958893ec42e06370 Mon Sep 17 00:00:00 2001 From: Naveen Gattu Date: Sun, 28 Nov 2021 21:47:36 -0800 Subject: [PATCH] more concise --- components/net/http_loader.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index f66fc4c6363..4f8824ae7ea 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -847,11 +847,10 @@ pub fn http_fetch( // Substep 4. response.actual_response_mut().location_url = location.map(|res| res.map(|mut url| { let current_url = request.current_url(); - let current_fragment = current_url.fragment(); - if url.fragment().is_none() && current_fragment.is_some() { - url.set_fragment(current_fragment); + match (current_url.fragment(), url.fragment()) { + (fragment @ Some(..), None) => { url.set_fragment(fragment); url }, + _ => url } - url })); // Substep 5.