From 03f61ead4821056a69c56713adefccd8e9c1b54b Mon Sep 17 00:00:00 2001 From: Madhas Date: Thu, 31 May 2018 17:48:52 +0300 Subject: [PATCH 1/2] add acceptable status codes property to network configuration --- .../NetworkService/NetworkServiceConfiguration.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/Structures/NetworkService/NetworkServiceConfiguration.swift b/Sources/Structures/NetworkService/NetworkServiceConfiguration.swift index 0424a985..855461cb 100644 --- a/Sources/Structures/NetworkService/NetworkServiceConfiguration.swift +++ b/Sources/Structures/NetworkService/NetworkServiceConfiguration.swift @@ -39,6 +39,9 @@ public struct NetworkServiceConfiguration { /// Server trust policies. public var serverTrustPolicies: [String: ServerTrustPolicy] + /// HTTP response status codes regarded as non-erroneous + public var acceptableStatusCodes: Set = Set(200..<300) + /// Session configuration for potential fine tuning public var sessionConfiguration: URLSessionConfiguration @@ -67,7 +70,7 @@ public extension NetworkServiceConfiguration { var sessionManager: SessionManager { return SessionManager(configuration: sessionConfiguration, serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies), - acceptableStatusCodes: Set(200..<300), + acceptableStatusCodes: acceptableStatusCodes, mappingQueue: .global()) } From 690c0532d1d78b9aa9201ebc9ec3f3aebea6a717 Mon Sep 17 00:00:00 2001 From: Madhas Date: Thu, 31 May 2018 17:51:33 +0300 Subject: [PATCH 2/2] update changelog and podspec --- CHANGELOG.md | 4 ++++ LeadKit.podspec | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5e99ca6..badf25a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 0.8.2 + +- **Add**: `acceptableStatusCodes` property to `NetworkServiceConfiguration` + ### 0.8.1 - **Add**: Support for `localizedComponent` for `FixedWidthInteger` diff --git a/LeadKit.podspec b/LeadKit.podspec index 715d9466..96b4d192 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "0.8.1" + s.version = "0.8.2" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKit" s.license = "Apache License, Version 2.0"