mirror of
https://github.com/munki/munki.git
synced 2026-01-05 22:20:00 -06:00
Improved logic for using stored etag or last-modified headers to avoid re-downloading resources
This commit is contained in:
@@ -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] {
|
||||
|
||||
Reference in New Issue
Block a user