summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/services')
-rw-r--r--src/services/api/rest/models.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/services/api/rest/models.py b/src/services/api/rest/models.py
index d65d6e1ec..23ae9be9d 100644
--- a/src/services/api/rest/models.py
+++ b/src/services/api/rest/models.py
@@ -17,6 +17,7 @@
# pylint: disable=too-few-public-methods
import json
+from html import escape
from enum import Enum
from typing import List
from typing import Union
@@ -31,6 +32,7 @@ from fastapi.responses import HTMLResponse
def error(code, msg):
+ msg = escape(msg, quote=False)
resp = {'success': False, 'error': msg, 'data': None}
resp = json.dumps(resp)
return HTMLResponse(resp, status_code=code)