Commit a88efc8d authored by Zachary Seguin's avatar Zachary Seguin

Merge branch 'fix-27' into 'master'

Handle double quotes and single quotes when removing encoding (Resolves #27)

Closes #27

See merge request !16
parents 76b75701 f5ff50b6
Pipeline #148 passed with stages
in 6 minutes and 17 seconds
......@@ -29,6 +29,7 @@ import pytz
import dateutil.parser
from celery.utils.log import get_task_logger
from lxml.etree import XMLSyntaxError
import re
from . import app, celery, db, redis
from ..xml import alert
......@@ -203,7 +204,7 @@ def process_heartbeat():
@celery.task(default_retry_delay=10, max_retries=None)
def process_alert(xml):
try:
xml = xml.replace('encoding="UTF-8"', '')
xml = re.sub("encoding=['\"][^'\"]*['\"]", "", xml, flags=re.IGNORECASE)
# Get the XML representation of the alert
a = alert.parseString(xml)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment