Closed jpirnay closed 1 week ago
The changes improve the web server's data handling to be compatible with Safari and add a new GET interface for command execution. The implementation has been refactored to better separate concerns, handle different response types, and properly process POST request bodies.
sequenceDiagram
participant Client
participant WebServer
participant Context
Client->>WebServer: Send GET/POST request
WebServer->>WebServer: parse_received_data()
WebServer->>WebServer: execute_data()
alt GET request
WebServer->>Context: Execute command from URL
else POST request
WebServer->>Context: Execute command from body
end
WebServer->>WebServer: build_response()
WebServer->>Client: respond_with_html() or respond_with_json()
classDiagram
class WebServer {
+receive(data)
+respond_with_html(con, send_list)
+respond_with_json(con, send_list)
+run_server()
-parse_received_data()
-execute_data()
-build_response(content)
-build_json(content)
}
note for WebServer "Refactored to handle Safari compatibility and new GET interface"
Change | Details | Files |
---|---|---|
Refactored data reception and processing logic |
|
meerk40t/network/web_server.py |
Added support for GET command interface |
|
meerk40t/network/web_server.py |
Improved response handling with content type support |
|
meerk40t/network/web_server.py |
Summary by Sourcery
Fix Safari compatibility issue in the web server's data reception method. Add a new GET interface for executing commands via URL parameters. Refactor the code to improve structure and readability, and introduce JSON response handling.
New Features:
Bug Fixes:
Enhancements: