From 9093ca4e6278ddc4de6ac34272864e2579c3c3d1 Mon Sep 17 00:00:00 2001 From: masakih Date: Tue, 1 May 2018 23:10:50 +0900 Subject: [PATCH] =?utf8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=83=95=E3=82=A9?= =?utf8?q?=E3=83=BC=E3=83=9E=E3=83=83=E3=82=BF=E3=82=92=E4=BD=BF=E3=81=84?= =?utf8?q?=E5=9B=9E=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KCD/CustomHTTPProtocol.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/KCD/CustomHTTPProtocol.swift b/KCD/CustomHTTPProtocol.swift index 0f5f492b..9bb625f8 100644 --- a/KCD/CustomHTTPProtocol.swift +++ b/KCD/CustomHTTPProtocol.swift @@ -59,14 +59,14 @@ private final class ThreadOperator: NSObject { extension HTTPURLResponse { - private var httpDateFormatter: DateFormatter { + private static var dateFormatter: DateFormatter = { let formatter = DateFormatter() formatter.dateFormat = "EEE',' dd' 'MMM' 'yyyy HH':'mm':'ss zzz" formatter.locale = Locale(identifier: "en_US") return formatter - } + }() func expires() -> Date? { @@ -81,7 +81,7 @@ extension HTTPURLResponse { } if let ex = (allHeaderFields["Expires"] as? String)?.lowercased(), - let exp = httpDateFormatter.date(from: ex) { + let exp = HTTPURLResponse.dateFormatter.date(from: ex) { return exp } -- 2.11.0