From 03993becebacdc0581e4fb3b6ad9db3dca8d6ecc Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Thu, 23 Oct 2025 11:52:51 -0700 Subject: [PATCH] Improved logic for using stored etag or last-modified headers to avoid re-downloading resources --- code/cli/munki/shared/network/fetch.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/cli/munki/shared/network/fetch.swift b/code/cli/munki/shared/network/fetch.swift index 28b6ff6b..bc44253f 100644 --- a/code/cli/munki/shared/network/fetch.swift +++ b/code/cli/munki/shared/network/fetch.swift @@ -336,11 +336,9 @@ func getHTTPfileIfChangedAtomically( resume: Bool = false, followRedirects: String = "none", ) throws -> Bool { - var eTag = "" var getOnlyIfNewer = false if pathExists(destinationPath) { - getOnlyIfNewer = true - // see if we have an etag attribute + // see if we have a stored etag or last-modified header do { let data = try getXattr(named: GURL_XATTR, atPath: destinationPath) if let headers = try readPlist(fromData: data) as? [String: String] {