the headers parameters used in the FH.cloud(path, method: method,args: params,headers: headers,completionHandler:) are not sent to the final request executed by the CloudRequest class;
I suggest the modifications here below in the CloudRequest class:
public func exec(completionHandler: CompletionBlock) -> Void {
let host = props.cloudHost
if (self.headers == nil) {
headers = [:]
}
if let sessionToken = dataManager.stringForKey("sessionToken") {
headers = ["x-fh-sessionToken": sessionToken]
}
if let props = config?.params {
headers = headers ?? [:]
for (key, value) in props {
let fhKey = "x-fh-\(key)"
if let value = value as? String {
headers![fhKey] = value
} else { // apppend JSOnified version
do {
let json = try NSJSONSerialization.dataWithJSONObject(value, options: NSJSONWritingOptions())
let string = NSString(data: json, encoding: NSUTF8StringEncoding)
headers![fhKey] = string as! String
} catch _ {}
}
}
}
request(method, host: host, path: path, args: args, headers: headers, completionHandler: completionHandler)
}
the headers parameters used in the FH.cloud(path, method: method,args: params,headers: headers,completionHandler:) are not sent to the final request executed by the CloudRequest class; I suggest the modifications here below in the CloudRequest class: