Django

Code

Ticket #2602 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] add User Agent to broken link emails

Reported by: ian@holsman.net Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords: session handling
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

i'm getting slammed by a bad bot.. this will give me some more information on what is causing the link error.

Index: common.py
===================================================================
--- common.py   (revision 3656)
+++ common.py   (working copy)
@@ -64,8 +64,9 @@
                 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','-none-')
                     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\nUA: %s\n" % (referer, request.get_full_path(),ua))
                 return response
 
         # Use ETags, if requested.

Attachments

Change History

09/21/06 20:28:48 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [3778]) Fixed #2602 -- Include User Agent in broken link emails. Thanks, Ian Holsman.


Add/Change #2602 ([patch] add User Agent to broken link emails)




Change Properties
Action