Skip to content

Commit 5fa2234

Browse files
Merge pull request #20 from contentstack/next
Issue resolved for URLCache
2 parents ccf7802 + 0f0ffa5 commit 5fa2234

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CONTENTSTACK_SDK_VERSION=1.5.0
1+
CONTENTSTACK_SDK_VERSION=1.5.1

.github/workflows/secrets-scan.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

Config.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CONTENTSTACK_SDK_VERSION = 1.5.0
1+
CONTENTSTACK_SDK_VERSION = 1.5.1

Sources/Stack.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class Stack: CachePolicyAccessible {
8686
self.config.sessionConfiguration.httpAdditionalHeaders = contentstackHTTPHeaders
8787
self.urlSession = URLSession(configuration: config.sessionConfiguration)
8888

89-
self.config.sessionConfiguration.urlCache = CSURLCache.default
89+
self.config.sessionConfiguration.urlCache = URLCache.shared
9090
}
9191

9292
/// Get instance of `ContentType` to fetch content-types and schema or fetch entries of specific content-type.
@@ -219,7 +219,7 @@ public class Stack: CachePolicyAccessible {
219219
let successMessage = "Success: 'GET' (\(response.statusCode)) \(url.absoluteString)"
220220
ContentstackLogger.log(.info, message: successMessage)
221221

222-
URLCache.shared.storeCachedResponse(
222+
CSURLCache.default.storeCachedResponse(
223223
CachedURLResponse(response: response,
224224
data: data),
225225
for: request
@@ -293,7 +293,7 @@ public class Stack: CachePolicyAccessible {
293293
}
294294

295295
private func cachedResponse(for request: URLRequest) -> Data? {
296-
if let response = URLCache.shared.cachedResponse(for: request) {
296+
if let response = CSURLCache.default.cachedResponse(for: request) {
297297
return response.data
298298
}
299299
return nil

0 commit comments

Comments
 (0)