summaryrefslogtreecommitdiff
path: root/django/middleware/common.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #6228: Changed common middleware to respect request-specific urlconf. ↵Karen Tracey2010-03-071-4/+5
| | | | | | Thanks trey, skevy, and mikexstudios. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12704 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed an 'assert False' I stupidly committed in [12165]Adrian Holovaty2010-01-101-2/+0
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@12166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #6094 -- Middleware exceptions are now caught by the core handler. ↵Adrian Holovaty2010-01-101-0/+2
| | | | | | Thanks, isagalaev git-svn-id: http://code.djangoproject.com/svn/django/trunk@12165 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #9199 -- We were erroneously only prepending "www" to the domain if weMalcolm Tredinnick2008-10-071-23/+35
| | | | | | | | | also needed to append a slash (when PREPEND_WWW=True). Based on a patch and tests from gonz. Thanks. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9184 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7379: fixed a subtle corner case involving URL encoding in ↵Jacob Kaplan-Moss2008-08-271-1/+1
| | | | | | `CommonMiddleware` git-svn-id: http://code.djangoproject.com/svn/django/trunk@8635 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #8381 -- Fixed a problem with appending slashes in the common middlewareMalcolm Tredinnick2008-08-211-2/+2
| | | | | | | | | when SCRIPT_NAME contains something other than '/'. Patch from jcassee. Also fixed the middleware tests to work with this patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8456 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7919 -- md5 and sha modules are deprecated since Python 2.5, use ↵Gary Wilson Jr2008-08-021-3/+3
| | | | | | hashlib module when available. Patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7228 -- Fixed our ETag header creation to meet the HTTP spec, by ↵Adrian Holovaty2008-06-161-1/+1
| | | | | | quoting it. Thanks, skjohn@us.ibm.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@7659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3228 -- Added new APPEND_SLASH handling behaviour in the common ↵Malcolm Tredinnick2007-12-021-15/+43
| | | | | | middleware. Makes customisation a bit easier. Thanks, Mihai Preda and Andy Gayton. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6852 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5762 -- Quoted the portions that make up the URL when appendingMalcolm Tredinnick2007-10-201-4/+6
| | | | | | | "www." or adding a trailing slash in common middleware. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6553 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added a get_host() method to HttpRequest. There is still an http.get_host() ↵Malcolm Tredinnick2007-09-151-2/+2
| | | | | | version in place, so this is fully backwards compatible. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4994 -- Send back set-cookie headers in "not modified" responses. ↵Malcolm Tredinnick2007-08-121-0/+2
| | | | | | Well spotted, colin@owlfish.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5878 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4484 -- Fixed APPEND_SLASH handling to handle an empty path value.Malcolm Tredinnick2007-07-131-1/+1
| | | | | | | Thanks, VesselinK. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5688 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed ETag computation to first check if an ETag header already exists in theMalcolm Tredinnick2007-06-171-2/+6
| | | | | | | response. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5483 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3206 -- Fixed typo in [5407]. This time with bonus testing. Thanks,Malcolm Tredinnick2007-06-021-1/+1
| | | | | | | Manuel Saelices. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5417 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3206 -- Changed ETag comparison to only return 304 when the normalMalcolm Tredinnick2007-06-011-1/+1
| | | | | | | | status code would be in the range 200 - 299. This matches RFC 2616 requirements. Based on a patch from Vinay Sajip. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5407 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4040 -- Changed uses of has_key() to "in". Slight performanceMalcolm Tredinnick2007-04-261-1/+1
| | | | | | | | improvement and forward-compatible with future Python releases. Patch from Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added client IP address to the e-mail that is sent when an internalLuke Plant2007-04-201-1/+3
| | | | | | | | broken link is detected. This is to help with filtering out misbehaving bots. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5043 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Improved detection of whether a URL is internal or not for the purposeLuke Plant2006-09-261-1/+7
| | | | | | | | of broken link e-mails (referred links from images.google were being misclassified). git-svn-id: http://code.djangoproject.com/svn/django/trunk@3870 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Altered [3778] change to match our coding/text style (django.middleware.common)Adrian Holovaty2006-09-251-2/+2
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@3834 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2602 -- Include User Agent in broken link emails. Thanks, Ian Holsman.Malcolm Tredinnick2006-09-221-1/+2
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@3778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2092: added a "is_secure()" method to HttpRequest which correctly ↵Jacob Kaplan-Moss2006-07-211-2/+2
| | | | | | handles the subtleties of mod_python's interaction with os.environ. This one's been bugging me for about a *year*, so many many thanks to k.shaposhnikov@gmail.com for figuring it out, and Tim Shaffer for pointing out this ticket. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3410 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Converted request.META['REQUEST_METHOD'] calls to request.method, throughout ↵Adrian Holovaty2006-06-201-1/+1
| | | | | | the Django codebase git-svn-id: http://code.djangoproject.com/svn/django/trunk@3171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2109 -- Convert old-style classes to new-style classes throughout ↵Adrian Holovaty2006-06-081-1/+1
| | | | | | Django. Thanks, Nicola Larosa git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Solved the POST-data-lost-after-redirect problem by raising RuntimeError ↵Adrian Holovaty2006-06-081-0/+2
| | | | | | when DEBUG=True in the CommonMiddleware git-svn-id: http://code.djangoproject.com/svn/django/trunk@3109 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly ↵Adrian Holovaty2006-05-021-6/+7
| | | | | | backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1569 -- HttpResponse now accepts iterators. Thanks, ManiacAdrian Holovaty2006-04-091-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@2639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1117 -- Added HttpResponsePermanentRedirectAdrian Holovaty2006-01-031-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@1816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed CommonMiddleware so it doesn't assume HTTP_HOST is set.Adrian Holovaty2005-12-051-3/+6
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@1548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* BACKWARDS-INCOMPATIBLE CHANGE -- Moved flatpages and redirects to standalone ↵Adrian Holovaty2005-11-111-11/+0
| | | | | | apps in django.contrib that are NOT installed by default. See http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges for full migration information. git-svn-id: http://code.djangoproject.com/svn/django/trunk@1166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Tiny docstring cleanup in middleware/common.pyAdrian Holovaty2005-11-061-5/+4
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@1096 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #333 and #440 -- Split DEFAULT_MIME_TYPE setting into ↵Adrian Holovaty2005-10-061-1/+1
| | | | | | DEFAULT_CONTENT_TYPE and DEFAULT_CHARSET. Thanks, Maniac. git-svn-id: http://code.djangoproject.com/svn/django/trunk@786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added USE_FLAT_PAGES setting, which defaults to True.Adrian Holovaty2005-10-051-18/+16
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #394 -- Trailing-slash redirects now retain duplicate name-value ↵Adrian Holovaty2005-09-021-2/+1
| | | | | | query-string pairs, instead of the first of each pair. Added a QueryDict.urlencode() method to accomplish this. Updated the docs. Thanks for the good catch, mlambert git-svn-id: http://code.djangoproject.com/svn/django/trunk@613 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed SessionMiddleware to use process_request instead of process_view -- ↵Adrian Holovaty2005-08-221-3/+0
| | | | | | that way it always gets called, even for 404s git-svn-id: http://code.djangoproject.com/svn/django/trunk@545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed special-case test for '_files' URL in common middleware -- thanks, ↵Adrian Holovaty2005-08-161-3/+0
| | | | | | Jeremy Dunck git-svn-id: http://code.djangoproject.com/svn/django/trunk@513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Imported Django from private SVN repository (created from r. 8825)Adrian Holovaty2005-07-131-0/+104
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3 bcc190cf-cafb-0310-a4f2-bffc1f526a37