Skip to content

Commit 512f84a

Browse files
authored
Releases/v0.2.0
## Improvements * Remove Alamofire Dependency * Merge pull request #1 from muxinc/fixes/remove-af
1 parent c6745e7 commit 512f84a

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

Package.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,13 @@ let package = Package(
1818
],
1919
dependencies: [
2020
// Dependencies declare other packages that this package depends on.
21-
.package(
22-
url: "https://github.com/Alamofire/Alamofire.git",
23-
.upToNextMajor(from: "5.6.1")
24-
),
2521
],
2622
targets: [
2723
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
2824
// Targets can depend on other targets in this package, and on products in packages this package depends on.
2925
.target(
3026
name: "MuxUploadSDK",
31-
dependencies: [
32-
"Alamofire",
33-
]
27+
dependencies: [ ]
3428
),
3529
.testTarget(
3630
name: "MuxUploadSDKTests",

Sources/MuxUploadSDK/Upload/ChunkWorker.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import Foundation
9-
import Alamofire
109

1110
/// Uploads a single chunk. Starts an internal Task on creation, which you can get with ``getTask``
1211
/// This class takes care of retries and backoff on a per-chunk basis
@@ -20,7 +19,6 @@ class ChunkWorker {
2019
let fileMIMEType: String
2120

2221
private var chunkStartTime: TimeInterval? = nil
23-
private var uploadRequest: UploadRequest? = nil
2422
private var lastSeenUpdate: Update = Update(progress: Progress(totalUnitCount: 10), bytesSinceLastUpdate: 0, chunkStartTime: 0, eventTime: 0)
2523
private var progressDelegate: ProgressHandler?
2624

@@ -183,8 +181,8 @@ fileprivate actor ChunkActor {
183181
let contentRangeValue = "bytes \(chunk.startByte)-\(chunk.endByte - 1)/\(chunk.totalFileSize)"
184182
var request = URLRequest(url: uploadURL)
185183
request.httpMethod = "PUT"
186-
request.headers.add(HTTPHeader(name: "Content-Type", value: fileMIMEType))
187-
request.headers.add(HTTPHeader(name: "Content-Range", value: contentRangeValue))
184+
request.setValue(fileMIMEType, forHTTPHeaderField: "Content-Type")
185+
request.setValue(contentRangeValue, forHTTPHeaderField: "Content-Range")
188186

189187
let (_, response) = try await urlSession.upload(for: request, from: chunk.chunkData)
190188
return response

apps/Test App/Upload Test App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)