mirror of
https://github.com/munki/munki.git
synced 2026-05-22 22:28:38 -05:00
Add optional pkginfo to middleware requests to match existing Python implementation
This commit is contained in:
@@ -184,13 +184,14 @@ func getURL(
|
||||
if pathExists(tempDownloadPath), !resume {
|
||||
try? FileManager.default.removeItem(atPath: tempDownloadPath)
|
||||
}
|
||||
|
||||
|
||||
let headers = headerDictFromList(customHeaders)
|
||||
|
||||
|
||||
// Run middleware
|
||||
var request = MunkiMiddlewareRequest(
|
||||
url: url,
|
||||
headers: headers
|
||||
headers: headers,
|
||||
pkginfo: pkginfo
|
||||
)
|
||||
request = runMiddleware(request)
|
||||
|
||||
@@ -205,7 +206,7 @@ func getURL(
|
||||
|
||||
let ignoreSystemProxy = pref("IgnoreSystemProxies") as? Bool ?? false
|
||||
|
||||
var options = GurlOptions(
|
||||
let options = GurlOptions(
|
||||
url: request.url,
|
||||
destinationPath: tempDownloadPath,
|
||||
additionalHeaders: request.headers,
|
||||
|
||||
@@ -66,4 +66,3 @@ func loadMiddlewarePlugin() throws -> MunkiMiddleware? {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import Foundation
|
||||
public struct MunkiMiddlewareRequest {
|
||||
var url: String
|
||||
var headers: [String: String]
|
||||
var pkginfo: PlistDict?
|
||||
}
|
||||
|
||||
public protocol MunkiMiddleware {
|
||||
|
||||
Reference in New Issue
Block a user