2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Make dig generate DoH URI using isc_nm_http_makeuri()

This commit replaces ad-hoc code for DoH connect URI construction with
isc_nm_http_makeuri(), making it handle IPv6 adresses properly (among
other things).
This commit is contained in:
Artem Boldariev
2021-08-12 10:18:26 +03:00
parent 530133c10f
commit 0403ca1ac2

View File

@@ -2799,9 +2799,10 @@ start_tcp(dig_query_t *query) {
#if HAVE_LIBNGHTTP2 #if HAVE_LIBNGHTTP2
} else if (query->lookup->https_mode) { } else if (query->lookup->https_mode) {
char uri[4096] = { 0 }; char uri[4096] = { 0 };
snprintf(uri, sizeof(uri), "https://%s:%u%s", isc_nm_http_makeuri(!query->lookup->http_plain,
query->userarg, (uint16_t)port, &query->sockaddr, query->userarg,
query->lookup->https_path); port, query->lookup->https_path,
uri, sizeof(uri));
if (!query->lookup->http_plain) { if (!query->lookup->http_plain) {
result = result =