Added comments

This commit is contained in:
Krishna Kishore Bandaru 2024-02-14 13:14:53 +05:30
parent a0b8459a79
commit 10b569e3a9

View File

@ -67,9 +67,17 @@ extension JSONDictionary {
}
valueString = baseValueString
}
/*If urlQuery value contains '/' , ':' these characters are passed without encoding, due to this we are seeing inconsistent behaviour.
For Eg: value contains a url: https://vzwsso/executeTask
Expected: https%3A%2F%2Fvzwsso%2FexecuteTask
Current: https://vzwsso/executeTask
So removed possible characters from urlQueryAllowed characterSet.
*/
var characterSet = CharacterSet.urlQueryAllowed
characterSet.remove("/")
characterSet.remove(":")
characterSet.remove("?")
characterSet.remove("=")
let queryItem = URLQueryItem(name: key, value: valueString.addingPercentEncoding(withAllowedCharacters: characterSet) ?? valueString)
queryItems.append(queryItem)
}