Skip to content

Commit c162144

Browse files
committed
fix: unset host header for status requests
A device will otherwise block the request, when requesting with a hostname instead of the plain IP
1 parent 33d7770 commit c162144

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pychromecast/dial.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def _get_status(
9090
_LOGGER.debug("Resolved service %s to %s", service, host)
9191
break
9292

93-
headers = {"content-type": "application/json"}
93+
# unsetting the host header, as requests with a domain would be blocked otherwise
94+
headers = {"host": "", "content-type": "application/json"}
9495

9596
if secure:
9697
url = FORMAT_BASE_URL_HTTPS.format(host) + path

0 commit comments

Comments
 (0)