Don't cache icon views used by the web view.

This commit is contained in:
Maurice Parker 2019-11-07 14:58:58 -06:00
parent 4f294c4d20
commit ac2506fd64
1 changed files with 6 additions and 4 deletions

View File

@ -30,10 +30,12 @@ class ArticleIconSchemeHandler: NSObject, WKURLSchemeHandler {
return
}
let response = URLResponse(url: responseURL, mimeType: "image/png", expectedContentLength: data.count, textEncodingName: nil);
urlSchemeTask.didReceive(response)
urlSchemeTask.didReceive(data)
urlSchemeTask.didFinish()
let headerFields = ["Cache-Control": "no-cache"]
if let response = HTTPURLResponse(url: responseURL, statusCode: 200, httpVersion: nil, headerFields: headerFields) {
urlSchemeTask.didReceive(response)
urlSchemeTask.didReceive(data)
urlSchemeTask.didFinish()
}
}
}