From 902e5a8324818665f4ad99c8afe89ee0f4723ed0 Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Tue, 14 Apr 2020 17:59:51 -0400 Subject: [PATCH] Improve monitoring script ingress --- shynet/analytics/views/ingress.py | 4 ++-- .../dashboard/templates/dashboard/pages/service_update.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shynet/analytics/views/ingress.py b/shynet/analytics/views/ingress.py index cd925ea..ed8141e 100644 --- a/shynet/analytics/views/ingress.py +++ b/shynet/analytics/views/ingress.py @@ -15,8 +15,8 @@ from ..tasks import ingress_request def ingress(request, service_uuid, identifier, tracker, payload): time = timezone.now() client_ip, is_routable = get_client_ip(request) - location = request.META.get("HTTP_REFERER") or "" - user_agent = request.META.get("HTTP_USER_AGENT") or "" + location = request.META.get("HTTP_REFERER", "").strip() + user_agent = request.META.get("HTTP_USER_AGENT", "").strip() ingress_request.delay( service_uuid, diff --git a/shynet/dashboard/templates/dashboard/pages/service_update.html b/shynet/dashboard/templates/dashboard/pages/service_update.html index 7bd739a..ff0a534 100644 --- a/shynet/dashboard/templates/dashboard/pages/service_update.html +++ b/shynet/dashboard/templates/dashboard/pages/service_update.html @@ -14,8 +14,8 @@

Place the following snippet at the end of the <body> tag on any page you'd like to track.

{% filter force_escape %} - + src="//{{request.site.domain}}{% url 'ingress:endpoint_pixel' object.uuid %}"> + {% endfilter %}