[components] Issue https://github.com/mozilla-mobile/android-components/issues/7719: Remove default headers for "User-Agent" and "Connection".

This commit is contained in:
Sebastian Kaspari
2020-09-16 19:13:36 +02:00
parent 1b70e1b247
commit 9d854eb6b7
11 changed files with 5 additions and 84 deletions

View File

@@ -4,6 +4,7 @@
package mozilla.components.lib.fetch.httpurlconnection
import mozilla.components.concept.fetch.BuildConfig
import mozilla.components.concept.fetch.Client
import mozilla.components.concept.fetch.Headers
import mozilla.components.concept.fetch.MutableHeaders
@@ -32,6 +33,7 @@ class HttpURLConnectionClient : Client() {
val connection = (URL(request.url).openConnection() as HttpURLConnection)
connection.setRequestProperty("User-Agent", "MozacFetch/${BuildConfig.LIBRARY_VERSION}")
connection.setupWith(request)
connection.addHeadersFrom(request, defaultHeaders = defaultHeaders)
connection.addBodyFrom(request)