rthalley / dnspython

a powerful DNS toolkit for python
http://www.dnspython.org
Other
2.46k stars 518 forks source link

Specifying a URL containing a port when using HTTP/3 doesn't work; the port is ignored. #1139

Closed bwelling closed 1 month ago

bwelling commented 1 month ago

Describe the bug

Specifying a URL containing a port when using HTTP/3 doesn't work; the port is ignored.

To Reproduce

import dns.message
import dns.query

url = 'https://example.com:10443/dns-query'
m = dns.message.make_query('google.com', 'A')
r = dns.query.https(m, url, verify=False, bootstrap_address='127.0.0.1', http_version=3)
print(r)

This should send a query to port 10443; it actually sends a query to port 443. With http_version=2, it correctly sends to the alternate port.

Context

rthalley commented 1 month ago

Fixed, thanks!