@@ -231,10 +231,6 @@ open class Client {
231
231
convert: (([String: Any]) -> T)? = nil,
232
232
completion: ((Result<T , {{ spec .title | caseUcfirst }}Error >) -> Void)? = nil
233
233
) {
234
- self.headers.merge(headers) { (_, new) in
235
- new
236
- }
237
-
238
234
let validParams = params.filter { $0.value != nil }
239
235
240
236
let queryParameters = method == "GET" && !validParams.isEmpty
@@ -256,7 +252,10 @@ open class Client {
256
252
return
257
253
}
258
254
259
- addHeaders(to: & request)
255
+ for (key, value) in self.headers.merging(headers, uniquingKeysWith: { $1 }) {
256
+ request.headers.add(name: key, value: value)
257
+ }
258
+
260
259
request.addDomainCookies()
261
260
262
261
if "GET" == method {
@@ -276,12 +275,6 @@ open class Client {
276
275
execute(request, withSink: sink, convert: convert, completion: completion)
277
276
}
278
277
279
- private func addHeaders(to request: inout HTTPClient.Request) {
280
- for (key, value) in self.headers {
281
- request.headers.add(name: key, value: value)
282
- }
283
- }
284
-
285
278
private func buildBody(
286
279
for request: inout HTTPClient.Request,
287
280
with params: [String: Any?]
0 commit comments