Supply fake User-Agent header

This commit is contained in:
Niels Andriesse 2021-07-09 14:50:35 +10:00
parent e7843e3af9
commit 7a388deb78

View File

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