A simple Python library to prevent your website from being attacked.
Type command:
$ pip install xss-shieldFunction excape(s: str, strict=True)
s: the string to parse
strict:
if not strict -> keep everything except
<script>tag
example:
import xss_shield
unsafe_str = '<script>alert("Bad.");</script>'
safe_str = xss_shield.escape(unsafe_str)The full example is in the examples/ directory.
The docs are availible here
