mirror of
https://github.com/Gabi-Zar/Pico-2W-Computer-Power-Controller.git
synced 2026-08-02 23:36:23 +02:00
Add favicon route
This commit is contained in:
9
main.py
9
main.py
@@ -317,6 +317,15 @@ async def serve_client(reader, writer):
|
|||||||
await writer.drain()
|
await writer.drain()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if method == "GET" and path == "/favicon.ico":
|
||||||
|
writer.write(
|
||||||
|
"HTTP/1.0 204 No Content\r\n"
|
||||||
|
"Connection: close\r\n"
|
||||||
|
"\r\n"
|
||||||
|
)
|
||||||
|
await writer.drain()
|
||||||
|
return
|
||||||
|
|
||||||
if method == "POST" and path == "/computer" and content_length > 0:
|
if method == "POST" and path == "/computer" and content_length > 0:
|
||||||
body = await reader.read(content_length)
|
body = await reader.read(content_length)
|
||||||
params = parse_form(body.decode())
|
params = parse_form(body.decode())
|
||||||
|
|||||||
Reference in New Issue
Block a user