Skip to content

Commit 6858cef

Browse files
committed
Fix #69: None instead of None in FormData.get()
1 parent dc7bec0 commit 6858cef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_httpserver/interfaces.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ def __repr__(self) -> str:
6565
return f"{self.__class__.__name__}({repr(self._storage)})"
6666

6767

68-
def _encode_html_entities(value: str) -> str:
68+
def _encode_html_entities(value: Union[str, None]) -> Union[str, None]:
6969
"""Encodes unsafe HTML characters that could enable XSS attacks."""
70+
if value is None:
71+
return None
72+
7073
return (
7174
str(value)
7275
.replace("&", "&")

0 commit comments

Comments
 (0)