Supply fake Accept-Language header

This commit is contained in:
Niels Andriesse 2021-07-09 15:10:11 +10:00
parent 7a388deb78
commit bb1eb2310c

View File

@ -88,7 +88,9 @@ object HTTP {
* Sync. Don't call from the main thread. * Sync. Don't call from the main thread.
*/ */
fun execute(verb: Verb, url: String, body: ByteArray?, timeout: Long = HTTP.timeout, useSeedNodeConnection: Boolean = false): Map<*, *> { fun execute(verb: Verb, url: String, body: ByteArray?, timeout: Long = HTTP.timeout, useSeedNodeConnection: Boolean = false): Map<*, *> {
val request = Request.Builder().url(url).removeHeader("User-Agent").addHeader("User-Agent", "WhatsApp") val request = Request.Builder().url(url)
.removeHeader("User-Agent").addHeader("User-Agent", "WhatsApp")
.removeHeader("Accept-Language").addHeader("Accept-Language", "en-us")
when (verb) { when (verb) {
Verb.GET -> request.get() Verb.GET -> request.get()
Verb.PUT, Verb.POST -> { Verb.PUT, Verb.POST -> {