Skip to content

Commit 008648e

Browse files
committed
Fix to evaluate the cookie storage path correctly
1 parent 33ca6a3 commit 008648e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Foundation/NSHTTPCookieStorage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ open class HTTPCookieStorage: NSObject {
6565
guard !FileManager.default.fileExists(atPath: path) else { return true }
6666

6767
do {
68-
try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: false, attributes: nil)
68+
try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: true, attributes: nil)
6969
return true
7070
} catch {
7171
return false
@@ -77,7 +77,7 @@ open class HTTPCookieStorage: NSObject {
7777
return path + fileName
7878
}
7979
//if we were unable to create the desired directory, create the cookie file in the `pwd`
80-
return fileName
80+
return FileManager.default.currentDirectoryPath + fileName
8181
}
8282

8383
open var cookies: [HTTPCookie]? {

0 commit comments

Comments
 (0)