vibesketch.server.guard¶
The local server’s front door: who may talk to it and how much they may send (#69).
A server bound to the loopback interface is reachable only from this
machine, but a web page in any browser on it can still send requests. A
page from another site is told apart by its Origin. A site that points
its own name at 127.0.0.1 (DNS rebinding) shares the server’s origin,
but cannot change the Host it sends. So a loopback server answers only
requests whose Host names this machine, and refuses state from pages
whose Origin is anything else. A server bound to another interface was
asked for by name; it takes any Host and leaves access to its network.
Every request body is also bounded (vibesketch.limits.MAX_REQUEST_BYTES):
it is read up to the bound and refused with 413 past it, before the
application parses anything.
Module Attributes
The names this machine answers to on its loopback interface. |
Functions
|
Classes
|
ASGI middleware: the |
- vibesketch.server.guard.LOOPBACK = frozenset({'127.0.0.1', '::1', 'localhost'})¶
The names this machine answers to on its loopback interface.