We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6585d3f commit 0fe7bd7Copy full SHA for 0fe7bd7
adafruit_httpserver/response.py
@@ -67,8 +67,8 @@ def _construct_response_bytes( # pylint: disable=too-many-arguments
67
content_length: Union[int, None] = None,
68
headers: Dict[str, str] = None,
69
body: str = "",
70
- ) -> str:
71
- """Send the constructed response over the given socket."""
+ ) -> bytes:
+ """Constructs the response bytes from the given parameters."""
72
73
response = f"{http_version} {status.code} {status.text}\r\n"
74
@@ -83,7 +83,7 @@ def _construct_response_bytes( # pylint: disable=too-many-arguments
83
84
response += f"\r\n{body}"
85
86
- return response
+ return response.encode("utf-8")
87
88
def send(self, conn: Union["SocketPool.Socket", "socket.socket"]) -> None:
89
"""
0 commit comments