Merge pull request #150 from TouchInstinct/fix/status_codes

Fix/status codes
This commit is contained in:
Andrey Ovsyannikov 2018-05-31 18:16:50 +03:00 committed by GitHub
commit 37b4c72374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# Changelog
### 0.8.2
- **Add**: `acceptableStatusCodes` property to `NetworkServiceConfiguration`
### 0.8.1
- **Add**: Support for `localizedComponent` for `FixedWidthInteger`

View File

@ -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"

View File

@ -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<Int> = 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())
}