MCPcopy Index your code
hub / github.com/stemdeckapp/stemdeck / _is_host_request

Function _is_host_request

app/main.py:336–344  ·  view source on GitHub ↗

True when the request originates from the machine StemDeck runs on — whether via loopback or one of its own interface addresses.

(host: str | None)

Source from the content-addressed store, hash-verified

334
335
336def _is_host_request(host: str | None) -> bool:
337 """True when the request originates from the machine StemDeck runs on —
338 whether via loopback or one of its own interface addresses."""
339 if _is_loopback(host):
340 return True
341 if not host:
342 return False
343 h = host[7:] if host.startswith("::ffff:") else host
344 return h in _local_ips()
345
346
347# Network availability gate (Settings → "Make StemDeck available on your

Callers 2

network_gateFunction · 0.85

Calls 2

_is_loopbackFunction · 0.85
_local_ipsFunction · 0.85

Tested by 1