Skip to content

Commit f1f0b72

Browse files
committed
docs: update CHANGELOG.md
1 parent 4fc9c29 commit f1f0b72

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 0.7.0 [unreleased]
22

3+
### Features
4+
1. [#38](https://github.com/influxdata/influxdb-client-swift/pull/38): Add configuration option for _Proxy_ and _Redirects_
5+
36
## 0.6.0 [2021-07-09]
47

58
### API

Sources/InfluxDBSwift/InfluxDBClient.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ public class InfluxDBClient {
6666
configuration.connectionProxyDictionary = self.options.connectionProxyDictionary
6767
configuration.protocolClasses = protocolClasses
6868

69-
class Helper: NSObject, URLSessionTaskDelegate {
70-
func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) {
71-
print("HEJ")
72-
completionHandler(nil)
73-
}
74-
}
75-
7669
if let urlSessionDelegate = self.options.urlSessionDelegate {
7770
session = URLSession(configuration: configuration, delegate: urlSessionDelegate, delegateQueue: nil)
7871
} else {

Tests/InfluxDBSwiftTests/MockHTTP.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class MockURLProtocol: URLProtocol {
3535

3636
do {
3737
let (response, data) = try handler(request, request.bodyValue)
38-
if let location = response.allHeaderFields["Location"], response.statusCode == 307 {
39-
let url = URLRequest(url: URL(string: location as! String)!)
40-
client?.urlProtocol(self, wasRedirectedTo: url, redirectResponse: response)
38+
let locationHeader = response.allHeaderFields["Location"]
39+
if let location = locationHeader as? String, let url = URL(string: location), response.statusCode == 307 {
40+
client?.urlProtocol(self, wasRedirectedTo: URLRequest(url: url), redirectResponse: response)
4141
} else {
4242
client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed)
4343
client?.urlProtocol(self, didLoad: data)

0 commit comments

Comments
 (0)