Skip to content

Commit

Permalink
add header o-host
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjia404 committed Jun 30, 2023
1 parent e35efbd commit ef40a0d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import okhttp3.dnsoverhttps.DnsOverHttps
import okhttp3.internal.toCanonicalHost
import java.net.InetAddress
import java.security.SecureRandom
import java.security.cert.X509Certificate
Expand Down Expand Up @@ -129,6 +130,7 @@ object HTTP {
val request = Request.Builder().url(url)
.removeHeader("User-Agent").addHeader("User-Agent", "WhatsApp") // Set a fake value
.removeHeader("Accept-Language").addHeader("Accept-Language", "en-us") // Set a fake value
.addHeader("o-host",url.toHttpUrl().host)
when (verb) {
Verb.GET -> request.get()
Verb.PUT, Verb.POST -> {
Expand Down

0 comments on commit ef40a0d

Please sign in to comment.