File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ extension AuthorizationProvider {
43
43
}
44
44
}
45
45
46
+ extension Foundation . URL {
47
+ var authenticationID : String ? {
48
+ guard let host = host? . lowercased ( ) else {
49
+ return nil
50
+ }
51
+ return host. isEmpty ? nil : host
52
+ }
53
+ }
54
+
46
55
// MARK: - netrc
47
56
48
57
public struct NetrcAuthorizationProvider : AuthorizationProvider {
@@ -103,7 +112,7 @@ public struct NetrcAuthorizationProvider: AuthorizationProvider {
103
112
}
104
113
105
114
private func machineName( for url: Foundation . URL ) -> String ? {
106
- url. host ? . lowercased ( )
115
+ url. authenticationID
107
116
}
108
117
109
118
private func machine( for url: Foundation . URL ) -> TSCUtility . Netrc . Machine ? {
@@ -248,7 +257,7 @@ public struct KeychainAuthorizationProvider: AuthorizationProvider {
248
257
}
249
258
250
259
private func server( for url: Foundation . URL ) -> String ? {
251
- url. host ? . lowercased ( )
260
+ url. authenticationID
252
261
}
253
262
254
263
private func `protocol`( for url: Foundation . URL ) -> CFString {
You can’t perform that action at this time.
0 commit comments