We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31d7484 commit 06e8e70Copy full SHA for 06e8e70
Sources/MuxUploadSDK/Upload/ChunkWorker.swift
@@ -170,7 +170,15 @@ fileprivate actor ChunkActor {
170
let urlSession: URLSession
171
172
func upload() async throws -> URLResponse {
173
- let contentRangeValue = "bytes \(chunk.startByte)-\(chunk.endByte - 1)/\(chunk.totalFileSize)"
+ let startByte = "\(chunk.startByte)"
174
+ let endByte: String
175
+ if chunk.endByte == 0 {
176
+ endByte = "0"
177
+ } else {
178
+ endByte = "\(chunk.endByte - 1)"
179
+ }
180
+
181
+ let contentRangeValue = "bytes \(startByte)-\(endByte)/\(chunk.totalFileSize)"
182
var request = URLRequest(url: uploadURL)
183
request.httpMethod = "PUT"
184
request.setValue("video/*", forHTTPHeaderField: "Content-Type")
0 commit comments