summaryrefslogtreecommitdiff
path: root/django/middleware/common.py
AgeCommit message (Collapse)Author
2016-03-23Fixed #26293 -- Fixed CommonMiddleware to process PREPEND_WWW and ↵ieatkittens
APPEND_SLASH independently.
2016-03-08Fixed #25971 -- Made BrokenLinkEmailsMiddleware ignore APPEND_SLASH redirects.harikrishnakanchi
If APPEND_SLASH=True and the referer is the URL without a trailing '/', then BrokenLinkEmailsMiddleware shouldn't send an email.
2016-02-09Fixed typo in django/middleware/common.py docstring.Liam Brenner
2016-01-05Fixed #26024 -- Fixed regression in ConditionalGetMiddleware ETag support.Denis Cornehl
Thanks Denis Cornehl for help with the patch.
2015-12-31Fixed #26013 -- Moved django.core.urlresolvers to django.urls.Marten Kenbeek
Thanks to Tim Graham for the review.
2015-12-10Fixed #25900 -- Fixed regression in CommonMiddleware ETag support.Derek J. Curtis
2015-11-26Fixed #25302 (again) -- Ignored scheme when checking for bad referers.Aymeric Augustin
The check introduced in 4ce433e was too strict in real life. The poorly implemented bots this patch attempted to ignore are sloppy when it comes to http vs. https.
2015-08-24Fixed #25302 -- Prevented BrokenLinkEmailsMiddleware from reporting 404s ↵Maxime Lorant
when Referer = URL.
2015-08-15Fixed #24935 -- Refactored common conditional GET handling.Denis Cornehl
2015-07-31Fixed #24720 -- Avoided resolving URLs that don't end in a slash twice in ↵Jay Cox
CommonMiddleware. This speeds up affected requests by about 5%.
2015-06-27Fixed #25017 -- Allowed customizing the DISALLOWED_USER_AGENTS responsesujayskumar
2015-04-21Fixed #24681 -- Removed Unicode bug in BrokenLinkEmailMiddlewareOliver A Bristow
2015-03-26Fixed #19910 -- Added slash to i18n redirect if APPEND_SLASH is set.Bas Peschier
This introduces a force_append_slash argument for request.get_full_path() which is used by RedirectFallbackMiddleware and CommonMiddleware when handling redirects for settings.APPEND_SLASH.
2015-03-18Fixed #23960 -- Removed http.fix_location_headerClaude Paroz
Thanks Carl Meyer for the report and Tim Graham for the review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-29Fixed #24145 -- Added PUT & PATCH to CommonMiddleware APPEND_SLASH redirect ↵Samuel Colvin
error.
2014-11-04Fixed #23531 -- Added CommonMiddleware.response_redirect_class.Berker Peksag
2014-03-21Removed settings.SEND_BROKEN_LINK_EMAILS per deprecation timeline.Tim Graham
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2013-11-28Fixed E125 pep8 warningsChristopher Medrela
2013-10-15Fixed #7603 -- Added a 'scheme' property to the HttpRequest objectUnai Zalakain
`HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is appropriately set and falls back to `HttpRequest._get_scheme()` (a hook for subclasses to implement) otherwise. `WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI environ variable to determine the request scheme. `HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is `https`. This provides a way to check the current scheme in templates, for example. It also allows us to deal with other schemes. Thanks nslater for the suggestion.
2013-06-29Advanced deprecation warnings for Django 1.7.Aymeric Augustin
2013-05-26Replaced `and...or...` constructs with PEP 308 conditional expressions.Ramiro Morales
2013-05-25Fixed #20099 -- Eased subclassing of BrokenLinkEmailsMiddlewareClaude Paroz
Thanks Ram Rachum for the report and the initial patch, and Simon Charette for the review.
2013-05-18Fixed #20356 -- Prevented crash when HTTP_REFERER contains non-asciiClaude Paroz
Thanks srusskih for the report and Aymeric Augustin for the review.
2013-01-15Fixed #19099 -- Split broken link emails out of common middleware.Aymeric Augustin
2012-12-29Removed IGNORABLE_404_STARTS/ENDS settings.Aymeric Augustin
2012-11-03Fixed #15152 -- Avoided crash of CommonMiddleware on broken querystringAymeric Augustin
2012-10-20Fixed #7581 -- Added streaming responses.Aymeric Augustin
Thanks mrmachine and everyone else involved on this long-standing ticket.
2012-09-20Imported getLogger directly from logging moduleClaude Paroz
This was a remainder of some 2.4 compatibility code.
2012-05-03Fixed #18042 -- Advanced deprecation warnings.Aymeric Augustin
Thanks Ramiro for the patch.
2012-03-02Fixed #17734 -- Made sure to only redirect translated URLs if they can ↵Jannis Leidel
actually be resolved to prevent unwanted redirects. Many thanks to Orne Brocaar and Anssi Kääriäinen for input. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09Fixed #17358 -- Updated logging calls to use official syntax for arguments ↵Jannis Leidel
instead of string interpolation. Thanks, spulec. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17480 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-06Fixed #16705 - Made the test client adhere to the WSGI spec -- in ↵Aymeric Augustin
particular, removed the assumption that environ['QUERY_STRING'] exists. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-24Made some small tweaks/fixes to documentation from IGNORABLE_404_URLS ↵Adrian Holovaty
changeset [16160] git-svn-id: http://code.djangoproject.com/svn/django/trunk@16275 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-05Fixed #15954 - New IGNORABLE_404_URLS setting that allows more powerful ↵Luke Plant
filtering of 404s to ignore Thanks to aaugustin for implementing this. (Technically this doesn't fix the original report, as we've decided against having *any* default values, but the new feature makes it possible, and the docs have an example addressing #15954). git-svn-id: http://code.djangoproject.com/svn/django/trunk@16160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28Removed a bunch more Python 2.4 workarounds now that we don't support that ↵Adrian Holovaty
version. Refs #15702 -- thanks to jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-26Fixed #15635 -- Converted two legacy old-style raise statements. Thanks, ↵Adrian Holovaty
DaNmarner git-svn-id: http://code.djangoproject.com/svn/django/trunk@15917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-30Fixed #15187 -- Ensure that missing page emails aren't sent when running ↵Russell Keith-Magee
under debug. Thanks to Dan Carroll for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15363 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-04Fixed sending mail on 404s to fail silently.Luke Plant
A failure in the e-mail system should not turn a 404 into a 500. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-02Fixed #14559 -- corrected some typos and misleading docstrings. Thanks to ↵Alex Gaynor
Gabriel Hurley for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14441 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-06Fixed #14406 -- Added a Python 2.4 compatibility to the logging interface. ↵Russell Keith-Magee
Thanks to Łukasz Rekucki for the report, and to Luke Plant for original patch this was based on. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-04Fixed #12012 -- Added support for logging. Thanks to Vinay Sajip for his ↵Russell Keith-Magee
draft patch, and to the many people who gave feedback during development of the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-07Fixed #6228: Changed common middleware to respect request-specific urlconf. ↵Karen Tracey
Thanks trey, skevy, and mikexstudios. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12704 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10Removed an 'assert False' I stupidly committed in [12165]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10Fixed #6094 -- Middleware exceptions are now caught by the core handler. ↵Adrian Holovaty
Thanks, isagalaev git-svn-id: http://code.djangoproject.com/svn/django/trunk@12165 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07Fixed #9199 -- We were erroneously only prepending "www" to the domain if weMalcolm Tredinnick
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
2008-08-27Fixed #7379: fixed a subtle corner case involving URL encoding in ↵Jacob Kaplan-Moss
`CommonMiddleware` git-svn-id: http://code.djangoproject.com/svn/django/trunk@8635 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-21Fixed #8381 -- Fixed a problem with appending slashes in the common middlewareMalcolm Tredinnick
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
2008-08-02Fixed #7919 -- md5 and sha modules are deprecated since Python 2.5, use ↵Gary Wilson Jr
hashlib module when available. Patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8193 bcc190cf-cafb-0310-a4f2-bffc1f526a37