From 10b569e3a9308e1ce1fee14eee23b13b34d48617 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Wed, 14 Feb 2024 13:14:53 +0530 Subject: [PATCH] Added comments --- MVMCore/MVMCore/Models/JSON/JSONHelper.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MVMCore/MVMCore/Models/JSON/JSONHelper.swift b/MVMCore/MVMCore/Models/JSON/JSONHelper.swift index 002e6a7..76c8c53 100644 --- a/MVMCore/MVMCore/Models/JSON/JSONHelper.swift +++ b/MVMCore/MVMCore/Models/JSON/JSONHelper.swift @@ -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) }