File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,22 @@ public class CouchDBClient {
171171 if response. statusCode == HTTPStatusCode . OK {
172172
173173 var data = Data ( )
174+ #if os(Linux) && swift(>=3.1)
175+ do {
176+ try response. readAllData ( into: & data)
177+
178+ let responseJSON = JSON ( data: data)
179+
180+ let uuidsJSON = responseJSON [ " uuids " ]
181+
182+ uuids = uuidsJSON. array? . flatMap ( { ( uuidJSON) -> String ? in
183+ return uuidJSON. string
184+ } )
185+
186+ } catch let caughtError {
187+ error = caughtError as? NSError ?? NSError ( domain: caughtError. localizedDescription, code: - 1 )
188+ }
189+ #else
174190 do {
175191 try response. readAllData ( into: & data)
176192
@@ -185,6 +201,7 @@ public class CouchDBClient {
185201 } catch let caughtError as NSError {
186202 error = caughtError
187203 }
204+ #endif
188205 } else {
189206 error = CouchDBUtils . createError ( response. statusCode, id: nil , rev: nil )
190207 }
You can’t perform that action at this time.
0 commit comments