Skip to content

Commit 48c3a02

Browse files
committed
Remove custom userAgent
This is already provided by HTTPClient
1 parent 54eccfc commit 48c3a02

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Sources/PackageRegistry/RegistryManager.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public enum RegistryError: Error {
2828
case invalidChecksum(expected: String, actual: String)
2929
}
3030

31-
fileprivate let userAgent = "SwiftPackageManager/\(ToolsVersion.currentToolsVersion)"
32-
3331
public final class RegistryManager {
3432
internal static var clientFactory: () -> HTTPClientProtocol = {
3533
var configuration = HTTPClientConfiguration()
@@ -62,8 +60,7 @@ public final class RegistryManager {
6260
method: .head,
6361
url: url,
6462
headers: [
65-
"Accept": "application/vnd.swift.registry.v1",
66-
"User-Agent": userAgent
63+
"Accept": "application/vnd.swift.registry.v1"
6764
]
6865
)
6966

@@ -92,8 +89,7 @@ public final class RegistryManager {
9289
method: .get,
9390
url: registryBaseURL,
9491
headers: [
95-
"Accept": "application/vnd.swift.registry.v1+json",
96-
"User-Agent": userAgent
92+
"Accept": "application/vnd.swift.registry.v1+json"
9793
]
9894
)
9995

@@ -141,8 +137,7 @@ public final class RegistryManager {
141137
method: .get,
142138
url: url,
143139
headers: [
144-
"Accept": "application/vnd.swift.registry.v1+swift",
145-
"User-Agent": userAgent
140+
"Accept": "application/vnd.swift.registry.v1+swift"
146141
]
147142
)
148143

@@ -189,8 +184,7 @@ public final class RegistryManager {
189184
method: .get,
190185
url: url,
191186
headers: [
192-
"Accept": "application/vnd.swift.registry.v1+zip",
193-
"User-Agent": userAgent
187+
"Accept": "application/vnd.swift.registry.v1+zip"
194188
]
195189
)
196190

0 commit comments

Comments
 (0)