Skip to content

Commit a56a507

Browse files
committed
Changes to some Server docstrings
1 parent f62899c commit a56a507

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

adafruit_httpserver/server.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@
3636
class Server: # pylint: disable=too-many-instance-attributes
3737
"""A basic socket-based HTTP server."""
3838

39-
host: str = None
40-
"""Host name or IP address the server is listening on."""
39+
host: str
40+
"""Host name or IP address the server is listening on. ``None`` if server is stopped."""
4141

42-
port: int = None
43-
"""Port the server is listening on."""
42+
port: int
43+
"""Port the server is listening on. ``None`` if server is stopped."""
44+
45+
root_path: str
46+
"""Root directory to serve files from. ``None`` if serving files is disabled."""
4447

4548
def __init__(
4649
self, socket_source: Protocol, root_path: str = None, *, debug: bool = False
@@ -59,6 +62,7 @@ def __init__(
5962
self._socket_source = socket_source
6063
self._sock = None
6164
self.headers = Headers()
65+
self.host, self.port = None, None
6266
self.root_path = root_path
6367
if root_path in ["", "/"] and debug:
6468
_debug_warning_exposed_files(root_path)
@@ -388,6 +392,7 @@ def headers(self) -> Headers:
388392
389393
server = Server(pool, "/static")
390394
server.headers = {
395+
"X-Server": "Adafruit CircuitPython HTTP Server",
391396
"Access-Control-Allow-Origin": "*",
392397
}
393398
"""

0 commit comments

Comments
 (0)