marinofaggiana 5 years ago
parent
commit
cf89e55e12
2 changed files with 4 additions and 4 deletions
  1. 1 1
      iOSClient/Main/CCMain.m
  2. 3 3
      iOSClient/Networking/NCCommunication.swift

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1227,7 +1227,7 @@
     
 #ifdef DEBUG
     
-    [[NCCommunication sharedInstance] readFolderWithServerUrl:serverUrl account:appDelegate.activeAccount user:appDelegate.activeUserID  password:appDelegate.activePassword completionHandler:^(NSArray<NCFile *> *files, NSString *account, NSError *error) {
+    [[NCCommunication sharedInstance] readFolderWithServerUrl:serverUrl account:appDelegate.activeAccount user:appDelegate.activeUserID password:appDelegate.activePassword depth:@"1" userAgent:[CCUtility getUserAgent] completionHandler:^(NSArray<NCFile *> *files, NSString *account, NSError *error) {
         for (NCFile *file in files) {
             //NSLog(file.etag);
         }

+ 3 - 3
iOSClient/Networking/NCCommunication.swift

@@ -58,7 +58,7 @@ class NCCommunication: NSObject {
     <trashbin-deletion-time xmlns=\"http://nextcloud.org/ns\"/>"
     """
     
-    @objc func readFolder(serverUrl: String, account: String, user: String, password: String, completionHandler: @escaping (_ result: [NCFile], _ account: String,_ error: Error?) -> Void) {
+    @objc func readFolder(serverUrl: String, account: String, user: String, password: String, depth: String, userAgent: String, completionHandler: @escaping (_ result: [NCFile], _ account: String,_ error: Error?) -> Void) {
         
         var files = [NCFile]()
 
@@ -73,9 +73,9 @@ class NCCommunication: NSObject {
         
         // Headers
         var headers: HTTPHeaders = [.authorization(username: user, password: password)]
-        headers.update(.userAgent(CCUtility.getUserAgent()))
+        headers.update(.userAgent(userAgent))
         headers.update(.contentType("application/xml"))
-        headers.update(name: "Depth", value: "1")
+        headers.update(name: "Depth", value: depth)
 
         // Parameters
         //let parameters: Parameters = ["":"<?xml version=\"1.0\" encoding=\"UTF-8\"?><d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><d:prop>" + NCResource + "</d:prop></d:propfind>"]