Minor updates (comments, sequence) in complete files.

This commit is contained in:
Boris Baldassari 2024-03-21 21:42:50 +01:00
parent 0148838952
commit 9a7e2b1486
2 changed files with 3 additions and 0 deletions

View file

@ -138,6 +138,7 @@ def parse_request_params(lines: list[str]) -> dict[str, str]:
raise ValueError(f"Request line is not a valid key/value pair: {l}")
params[kv[0]] = kv[1]
return params

View file

@ -86,6 +86,7 @@ def handle_client(c: socket.socket, addr: tuple[str, int], root:str):
"""
# Read the socket.
buf = c.recv(_BUF_SIZE)
# Parse the request to get the headers - call parse_request().
@ -139,6 +140,7 @@ def prepare_resource(root: str, req: dict):
content_type = get_http_content_type(res_extension)
content, code = get_resource(res_path)
# Then call prepare_reply to build the final reply.
return prepare_reply(content, content_type, code)