Commit Graph

65 Commits

Author SHA1 Message Date
Adrian Holovaty 0f4fb9755c Fixed #3872 -- Fixed incorrect handling of HTTP_X_FORWARDED_FOR in SetRemoteAddrFromForwardedFor. Thanks, Simon Willison and gregorth
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-16 16:54:16 +00:00
Malcolm Tredinnick 4b610f42d3 Added a get_host() method to HttpRequest. There is still an http.get_host() 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
2007-09-15 17:46:03 +00:00
Jacob Kaplan-Moss ca9388cdaf Added more dict-like methods to HttpResponse as part of the response.headers -> response._headers move, and fixed a few direct uses of response.headers in Django itself. Thanks to PhiR for tracking down and slaying these bugs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6235 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 22:33:56 +00:00
Malcolm Tredinnick 0e7299e10a Fixed #4994 -- Send back set-cookie headers in "not modified" responses. Well spotted, colin@owlfish.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5878 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-12 13:10:45 +00:00
Malcolm Tredinnick c050b6a25a Fixed #4946 -- Added some small improvements to Gzip middleware. Thanks, colin@owlfish.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-12 12:29:25 +00:00
Malcolm Tredinnick 5dd9a2ab38 Fixed #4199 -- Changed date formatting in HTTP expires header to be spec
compliant. Thanks, Chris Bennett.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-16 03:50:22 +00:00
Malcolm Tredinnick 50a3cea8b6 Fixed #4484 -- Fixed APPEND_SLASH handling to handle an empty path value.
Thanks, VesselinK.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5688 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-13 14:33:46 +00:00
Malcolm Tredinnick 9b397ee50d Changed ETag computation to first check if an ETag header already exists in the
response.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5483 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-17 07:21:09 +00:00
Malcolm Tredinnick 7de9f79969 Fixed #3206 -- Fixed typo in [5407]. This time with bonus testing. Thanks,
Manuel Saelices.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5417 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-02 07:55:41 +00:00
Malcolm Tredinnick 63a1304f54 Fixed #3206 -- Changed ETag comparison to only return 304 when the normal
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
2007-06-01 11:47:54 +00:00
Malcolm Tredinnick 439cb4047f Fixed #4040 -- Changed uses of has_key() to "in". Slight performance
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
2007-04-26 13:30:48 +00:00
Luke Plant 9f180a1bc5 Added client IP address to the e-mail that is sent when an internal
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
2007-04-20 11:24:53 +00:00
Adrian Holovaty 6481cf43f9 Fixed #3808 -- Fixed some typos in comments. Thanks, Collin Grady
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-25 18:05:01 +00:00
Jacob Kaplan-Moss 5bafb499e7 Fixed #3052: GZIP middleware now correctly reports Content-Length. Thanks, simonbun.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-22 20:31:09 +00:00
Luke Plant 8b216eb865 Improved detection of whether a URL is internal or not for the purpose
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
2006-09-26 18:49:28 +00:00
Adrian Holovaty 33a9a8f21a Altered [3778] change to match our coding/text style (django.middleware.common)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3834 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25 17:25:39 +00:00
Malcolm Tredinnick 0fee26935d Fixed #2747 -- Make X-Headers work for staff members. Admins with dyanmic IP
addresses can now use bookmarklets. Thanks, Maximillian Dornseif.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22 03:17:28 +00:00
Malcolm Tredinnick 3efd4dcd2d 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
2006-09-22 01:28:47 +00:00
Adrian Holovaty d592ca487a Fixed #2541 -- Added helpful error message for CacheMiddleware in the case of CACHE_ANONYMOUS_ONLY=True and uninstalled/unordered AuthenticationMiddleware. Thanks, dummy@habmalnefrage.de
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-18 03:31:13 +00:00
Adrian Holovaty 8f065bba6b Fixed #2552 -- Added SetRemoteAddrFromForwardedFor middleware and documentation. Thanks, Ian Holsman
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3602 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-18 03:12:36 +00:00
Jacob Kaplan-Moss 77f1b8a50d Fixed #2449 -- gzip middleware no longer gzips Javascript. Thanks for the prob, ubernostrum
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3503 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-31 21:31:35 +00:00
Jacob Kaplan-Moss a926046ba6 Second half of little cleanup tweaks suggested by pyflakes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-21 20:39:17 +00:00
Jacob Kaplan-Moss e9a236d86c Fixed #2092: added a "is_secure()" method to HttpRequest which correctly 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
2006-07-21 16:20:22 +00:00
Adrian Holovaty 27c49b69b8 Fixed #2392 -- Fixed CACHE_MIDDLEWARE_ANONYMOUS_ONLY to use attribute access to django.conf.settings
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3406 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-21 14:41:38 +00:00
Adrian Holovaty 6ab20c5475 Small style fixes to docs from [3395]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3397 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-20 15:45:16 +00:00
Jacob Kaplan-Moss 3e95ef5374 Oops, fixed small typo in [3395]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3396 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-20 15:37:51 +00:00
Jacob Kaplan-Moss 2a8a32c449 Added a CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting which makes the cache ignore pages served to authenticated users. Fixes #1509 (thanks, Matt).
Also added a FAQ entry about using this setting to avoid caching of the admin interface. 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3395 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-20 15:37:12 +00:00
Adrian Holovaty 37addba352 Converted request.META['REQUEST_METHOD'] calls to request.method, throughout the Django codebase
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-20 04:34:13 +00:00
Adrian Holovaty 2abfd5dd58 Fixed #2109 -- Convert old-style classes to new-style classes throughout Django. Thanks, Nicola Larosa
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08 05:00:13 +00:00
Adrian Holovaty 3aa6b0556f Solved the POST-data-lost-after-redirect problem by raising RuntimeError when DEBUG=True in the CommonMiddleware
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3109 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08 03:47:18 +00:00
Adrian Holovaty 503a27d212 Fixed #1707 -- LocaleMiddleware now sets Content-Language header. Thanks, ubernostrum
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2843 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-05 03:19:16 +00:00
Adrian Holovaty f69cf70ed8 MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly 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
2006-05-02 01:31:56 +00:00
Adrian Holovaty bc4638d722 Fixed #1569 -- HttpResponse now accepts iterators. Thanks, Maniac
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-04-09 23:54:34 +00:00
Adrian Holovaty bf16befc43 Fixed #1339 -- Added keys() and items() methods to session objects. Thanks, Ned Batchelder
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-10 21:33:07 +00:00
Adrian Holovaty 44e6ce6552 Fixed #1048 -- Fixed AttributeError in sessions framework when SESSION_SAVE_EVERY_REQUEST is True and no cookie has been set yet. Thanks, Jiri Barton
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1978 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-15 06:18:03 +00:00
Adrian Holovaty 3234a932b2 Fixed #1117 -- Added HttpResponsePermanentRedirect
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-03 23:57:14 +00:00
Adrian Holovaty f7f812cd70 Fixed #1137 -- Added a _contains_() method to SessionWrapper. Thanks, Brant
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1793 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-29 19:17:32 +00:00
Adrian Holovaty 79be9b2e7d Changed CommonMiddleware so it doesn't assume HTTP_HOST is set.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-05 15:25:55 +00:00
Adrian Holovaty cc3660c07d Fixed #878 -- URLconf regex captures no longer have to be named groups. Old URLconfs (with named groups) still work. This is backwards-incompatible if you've defined custom middleware with a process_view function. See http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1470 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-27 22:08:51 +00:00
Adrian Holovaty 3895a825a9 Added SESSION_SAVE_EVERY_REQUEST setting.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-20 17:16:13 +00:00
Adrian Holovaty 1b035c35d9 BACKWARDS-INCOMPATIBLE CHANGE -- Moved flatpages and redirects to standalone 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
2005-11-11 04:45:05 +00:00
Adrian Holovaty 7e28ba0b4c Tiny docstring cleanup in middleware/common.py
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1096 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-06 21:55:57 +00:00
Jacob Kaplan-Moss 5cf8f68423 Merged i18n branch into the trunk! Fixes #65, and perhaps some others. NB: this means that the i18n branch is now obsolete and will be made read-only.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-04 04:59:46 +00:00
Adrian Holovaty 390666ac2b Fixed #508 -- Added support for 'expires' in cookies and changed session middleware to set 'expires' in addition to 'max_age'. Thanks, mark@junklight.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1035 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-01 01:02:07 +00:00
Adrian Holovaty ed2f2419a1 Fixed #647 -- Fixed cache middleware not to expect _cache_update_cache, in case of 404s and 500s. Thanks, Eugene
git-svn-id: http://code.djangoproject.com/svn/django/trunk@954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-19 13:44:55 +00:00
Adrian Holovaty f07e5d4f5d Fixed #627 -- BACKWARDS-INCOMPATIBLE CHANGE. Admin is now an app, not a middleware. See BackwardsIncompatibleChanges for a full list of changes and information on how to update your code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-19 01:09:05 +00:00
Adrian Holovaty f71f854628 Fixed #626 -- Moved template modules to django.core.template package. django.core.template_loader is deprecated, in favor of django.core.template.loader.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-14 20:10:13 +00:00
Adrian Holovaty b4e2d12b1f Fixed #599 -- locmem cache now uses deepcopy() to prevent aliasing. Thanks, Hugo
git-svn-id: http://code.djangoproject.com/svn/django/trunk@821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-10 13:56:39 +00:00
Adrian Holovaty d65526d688 Fixed #580 -- Added mega support for generating Vary headers, including some view decorators, and changed the CacheMiddleware to account for the Vary header. Also added GZipMiddleware and ConditionalGetMiddleware, which are no longer handled by CacheMiddleware itself. Also updated the cache.txt and middleware.txt docs. Thanks to Hugo and Sune for the excellent patches
git-svn-id: http://code.djangoproject.com/svn/django/trunk@810 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-09 00:55:08 +00:00
Adrian Holovaty ab9aacd4db Fixed #333 and #440 -- Split DEFAULT_MIME_TYPE setting into DEFAULT_CONTENT_TYPE and DEFAULT_CHARSET. Thanks, Maniac.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-06 02:27:08 +00:00