@@ -6,8 +6,6 @@ import Foundation
66import AsyncHTTPClient
77@_exported import AppwriteModels
88
9- typealias CookieListener = ( _ existing: [ String ] , _ new: [ String ] ) -> Void
10-
119let DASHDASH = " -- "
1210let CRLF = " \r \n "
1311
@@ -18,8 +16,6 @@ open class Client {
1816
1917 open var endPoint = " https://HOSTNAME/v1 "
2018
21- open var endPointRealtime : String ? = nil
22-
2319 open var headers : [ String : String ] = [
2420 " content-type " : " application/json " ,
2521 " x-sdk-name " : " Swift " ,
@@ -35,8 +31,6 @@ open class Client {
3531
3632 internal var http : HTTPClient
3733
38- internal static var cookieListener : CookieListener ? = nil
39-
4034 private static let boundaryChars = " abcdefghijklmnopqrstuvwxyz1234567890 "
4135
4236 private static let boundary = randomBoundary ( )
@@ -49,7 +43,6 @@ open class Client {
4943 http = Client . createHTTP ( )
5044 addUserAgentHeader ( )
5145 addOriginHeader ( )
52- NotificationHandler . shared. client = self
5346 }
5447
5548 private static func createHTTP(
@@ -222,38 +215,6 @@ open class Client {
222215 open func setEndpoint( _ endPoint: String ) -> Client {
223216 self . endPoint = endPoint
224217
225- if ( self . endPointRealtime == nil && endPoint. starts ( with: " http " ) ) {
226- self . endPointRealtime = endPoint
227- . replacingOccurrences ( of: " http:// " , with: " ws:// " )
228- . replacingOccurrences ( of: " https:// " , with: " wss:// " )
229- }
230-
231- return self
232- }
233-
234- ///
235- /// Set realtime endpoint.
236- ///
237- /// @param String endPoint
238- ///
239- /// @return Client
240- ///
241- open func setEndpointRealtime( _ endPoint: String ) -> Client {
242- self . endPointRealtime = endPoint
243-
244- return self
245- }
246-
247- ///
248- /// Set push provider ID.
249- ///
250- /// @param String endpoint
251- ///
252- /// @return this
253- ///
254- open func setPushProviderId( _ providerId: String ) -> Client {
255- NotificationHandler . shared. providerId = providerId
256-
257218 return self
258219 }
259220
@@ -378,15 +339,6 @@ open class Client {
378339
379340 switch response. status. code {
380341 case 0 ..< 400 :
381- if response. headers [ " Set-Cookie " ] . count > 0 {
382- let domain = URL ( string: request. url) !. host!
383- let existing = UserDefaults . standard. stringArray ( forKey: domain)
384- let new = response. headers [ " Set-Cookie " ]
385-
386- Client . cookieListener ? ( existing ?? [ ] , new)
387-
388- UserDefaults . standard. set ( new, forKey: domain)
389- }
390342 switch T . self {
391343 case is Bool . Type :
392344 return true as! T
0 commit comments