Opened 14 years ago
Closed 14 years ago
#15930 closed Bug (invalid)
middleware.common.py doesn't parse denied_user_agents
Reported by: | rickeyski | Owned by: | nobody |
---|---|---|---|
Component: | HTTP handling | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I tried to set denied user agents and django raised the error str does not have method .search for user_agent_regex.search. Changing the declaration to re.search(user_agent_regex,request.METAuser agent) fixed the problem. The diff is attached
Attachments (1)
Change History (2)
by , 14 years ago
Attachment: | django.diff added |
---|
comment:1 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
The docs state that settings.DISALLOWED_USER_AGENTS
must be a "list of compiled regular expression objects".
See http://docs.djangoproject.com/en/dev/ref/settings/#disallowed-user-agents
You have provided a list of strings instead.
You should write DISALLOWED_USER_AGENTS = (re.compile(....), ...)
svn diff of bug fix