From 3efd4dcd2d03c235a1b28d382466440a33c271f9 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 22 Sep 2006 01:28:47 +0000 Subject: [PATCH] Fixed #2602 -- Include User Agent in broken link emails. Thanks, Ian Holsman. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3778 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/middleware/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/middleware/common.py b/django/middleware/common.py index d63b71fed7..4f060b8590 100644 --- a/django/middleware/common.py +++ b/django/middleware/common.py @@ -64,8 +64,9 @@ class CommonMiddleware(object): is_internal = referer and (domain in referer) path = request.get_full_path() if referer and not _is_ignorable_404(path) and (is_internal or '?' not in referer): + ua = request.META.get('HTTP_USER_AGENT','') mail_managers("Broken %slink on %s" % ((is_internal and 'INTERNAL ' or ''), domain), - "Referrer: %s\nRequested URL: %s\n" % (referer, request.get_full_path())) + "Referrer: %s\nRequested URL: %s\nUser Agent: %s\n" % (referer, request.get_full_path(), ua)) return response # Use ETags, if requested.