File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,10 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
23
23
public struct Progress : Sendable {
24
24
public var totalBytes : Int ?
25
25
public var receivedBytes : Int
26
+ public var responseHead : HTTPResponseHead !
26
27
}
27
28
28
- private var progress = Progress ( totalBytes: nil , receivedBytes: 0 )
29
+ private var progress = Progress ( totalBytes: nil , receivedBytes: 0 , responseHead : nil )
29
30
30
31
public typealias Response = Progress
31
32
@@ -135,6 +136,8 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
135
136
) -> EventLoopFuture < Void > {
136
137
self . reportHead ? ( task, head)
137
138
139
+ self . progress. responseHead = head
140
+
138
141
if let totalBytesString = head. headers. first ( name: " Content-Length " ) ,
139
142
let totalBytes = Int ( totalBytesString)
140
143
{
You can’t perform that action at this time.
0 commit comments