Skip to content

Commit

Permalink
Fix #69: 'None' instead of None in FormData.get()
Browse files Browse the repository at this point in the history
  • Loading branch information
michalpokusa committed Sep 1, 2023
1 parent dc7bec0 commit 4ec080e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adafruit_httpserver/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ def __repr__(self) -> str:
return f"{self.__class__.__name__}({repr(self._storage)})"


def _encode_html_entities(value: str) -> str:
def _encode_html_entities(value: Union[str, None]) -> Union[str, None]:
"""Encodes unsafe HTML characters that could enable XSS attacks."""
if value is None:
return None

return (
str(value)
.replace("&", "&")
Expand Down

0 comments on commit 4ec080e

Please sign in to comment.