Skip to content

Commit e6208e8

Browse files
committed
fixup downloader
1 parent 9e1a956 commit e6208e8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Coder Desktop/VPNLib/Downloader.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ public actor Downloader {
117117
var req = URLRequest(url: src)
118118
if FileManager.default.fileExists(atPath: dest.path) {
119119
if let existingFileData = try? Data(contentsOf: dest) {
120-
let sha1Hash = Insecure.SHA1.hash(data: existingFileData)
121-
let etag = sha1Hash.map { String(format: "%02x", $0) }.joined()
122-
// ETag header needs to be quoted
123-
req.setValue("\"\(etag)\"", forHTTPHeaderField: "If-None-Match")
120+
req.setValue(etag(data: existingFileData), forHTTPHeaderField: "If-None-Match")
124121
}
125122
}
126123
// TODO: Add Content-Length headers to coderd, add download progress delegate

0 commit comments

Comments
 (0)