True when the request originates from the machine StemDeck runs on — whether via loopback or one of its own interface addresses.
(host: str | None)
| 334 | |
| 335 | |
| 336 | def _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 |