We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e1a956 commit e6208e8Copy full SHA for e6208e8
Coder Desktop/VPNLib/Downloader.swift
@@ -117,10 +117,7 @@ public actor Downloader {
117
var req = URLRequest(url: src)
118
if FileManager.default.fileExists(atPath: dest.path) {
119
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")
+ req.setValue(etag(data: existingFileData), forHTTPHeaderField: "If-None-Match")
124
}
125
126
// TODO: Add Content-Length headers to coderd, add download progress delegate
0 commit comments