Skip to content

Commit

Permalink
fix: unset host header for status requests
Browse files Browse the repository at this point in the history
A device will otherwise block the request, when requesting with a hostname instead of the plain IP
  • Loading branch information
DerEnderKeks committed Feb 27, 2024
1 parent 33d7770 commit c162144
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pychromecast/dial.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def _get_status(
_LOGGER.debug("Resolved service %s to %s", service, host)
break

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

if secure:
url = FORMAT_BASE_URL_HTTPS.format(host) + path
Expand Down

0 comments on commit c162144

Please sign in to comment.