@@ -44,18 +44,13 @@ open class HTTPWebRequestDelivery : NSObject, WebRequestDelivery {
4444
4545 if ( pathComponents. count > 1 ) {
4646 let queryComponents = pathComponents [ 1 ] . components ( separatedBy: " & " )
47+ urlComponents. queryItems = queryComponents
48+ . map {
49+ let keyVal = $0. components ( separatedBy: " = " )
50+ return URLQueryItem ( name: keyVal. first ?? " " , value: keyVal. last ?? " " ) }
51+ } else if let urlParams = request. urlParameters {
4752 urlComponents. queryItems =
48- queryComponents
49- . map {
50- let keyVal = $0. components ( separatedBy: " = " )
51- return URLQueryItem ( name: WebRequest . urlEncode ( keyVal. first ?? " " ) ,
52- value: WebRequest . urlEncode ( keyVal. last ?? " " ) ) }
53- }
54- else if let urlParams = request. urlParameters {
55- urlComponents. queryItems =
56- urlParams
57- . map { URLQueryItem ( name: WebRequest . urlEncode ( $0. key) ,
58- value: WebRequest . urlEncode ( $0. value) ) }
53+ urlParams. map { URLQueryItem ( name: $0. key, value: $0. value) }
5954 }
6055
6156 return urlComponents. url
@@ -146,7 +141,7 @@ open class HTTPWebRequestDelivery : NSObject, WebRequestDelivery {
146141 let result = WebRequest . Result ( status: status, headers: headers, data: data)
147142 try request. completion ? ( result, request)
148143 }
149-
144+
150145 open func onDataReceived( request: WebRequest , status: Int , percentComplete: Int , target: URL ) throws {
151146 let result = WebRequest . Result ( status: status, headers: [ : ] , data: nil )
152147 try request. onDataReceived ? ( result, request, percentComplete, target) ;
0 commit comments