Skip to content

Commit

Permalink
sanitize-html (#56)
Browse files Browse the repository at this point in the history
* sanitize-html

* try nh3

* revert

* remove nh3 import
  • Loading branch information
maaikelimper authored Apr 23, 2024
1 parent d4e7624 commit 629f8ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wis2box_api/plugins/process/publish_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,16 @@ def execute(self, data):
try:
# create the message out of the metadata
msg = metadata
# dump the message to a string and sanitize html
msg = json.dumps(msg).replace('<', '&lt;').replace('>', '&gt;')
# publish notification on internal broker
private_auth = {
'username': BROKER_USERNAME,
'password': BROKER_PASSWORD
}
topic = 'wis2box/dataset/publication'
publish.single(topic=topic,
payload=json.dumps(msg),
payload=msg,
qos=1,
retain=False,
hostname=BROKER_HOST,
Expand Down

0 comments on commit 629f8ca

Please sign in to comment.