mirror of
https://github.com/munki/munki.git
synced 2026-02-12 18:19:54 -06:00
When building http(s) headers from AdditionalHttpHeaders, properly handle header values that contain : characters. Addresses #1296
This commit is contained in:
@@ -131,9 +131,9 @@ func headerDictFromList(_ strList: [String]?) -> [String: String] {
|
||||
if let strList {
|
||||
for item in strList {
|
||||
if item.contains(":") {
|
||||
let parts = item.components(separatedBy: ":")
|
||||
let parts = item.split(separator: ":", maxSplits: 1)
|
||||
if parts.count == 2 {
|
||||
headerDict[parts[0]] = parts[1].trimmingCharacters(in: .whitespaces)
|
||||
headerDict[String(parts[0])] = String(parts[1]).trimmingCharacters(in: .whitespaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user