From 98592c314c8113d8dc1db89dd07e49c022ecc4f5 Mon Sep 17 00:00:00 2001 From: Fernando Bunn Date: Wed, 26 Jul 2023 13:01:45 +0100 Subject: [PATCH] Fix wallet download issue (#1865) Task/Issue URL: https://app.asana.com/0/414235014887631/1205114051781535/f Description: Adds user agent to download tasks --- DuckDuckGo/URLDownloadSession.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/URLDownloadSession.swift b/DuckDuckGo/URLDownloadSession.swift index fc783a108d..85e4d5e6ae 100644 --- a/DuckDuckGo/URLDownloadSession.swift +++ b/DuckDuckGo/URLDownloadSession.swift @@ -38,7 +38,10 @@ class URLDownloadSession: NSObject, DownloadSession { if let session = session { self.session = session } else { - self.session = URLSession(configuration: .ephemeral, delegate: self, delegateQueue: .main) + let configuration = URLSessionConfiguration.ephemeral + let userAgent = DefaultUserAgentManager.shared.userAgent(isDesktop: false) + configuration.httpAdditionalHeaders = ["user-agent": userAgent] + self.session = URLSession(configuration: configuration, delegate: self, delegateQueue: .main) } self.task = self.session?.downloadTask(with: url) }