Skip to content

Commit

Permalink
fix url reference
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke committed Jan 17, 2025
1 parent 25b4ec6 commit 5b0e466
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,17 @@ class DnsOverHttps internal constructor(
Request.Builder().header("Accept", DNS_MESSAGE.toString()).apply {
val query = DnsRecordCodec.encodeQuery(hostname, type)

val requestUrl: HttpUrl = this@DnsOverHttps.url
val dnsUrl: HttpUrl = this@DnsOverHttps.url
if (post) {
url(requestUrl)
url(dnsUrl)
.cacheUrlOverride(
requestUrl.newBuilder()
dnsUrl.newBuilder()
.addQueryParameter("hostname", hostname).build(),
)
.post(query.toRequestBody(DNS_MESSAGE))
} else {
val encoded = query.base64Url().replace("=", "")
val requestUrl = requestUrl.newBuilder().addQueryParameter("dns", encoded).build()
val requestUrl = dnsUrl.newBuilder().addQueryParameter("dns", encoded).build()

url(requestUrl)
}
Expand Down

0 comments on commit 5b0e466

Please sign in to comment.