Django

Code

Show
Ignore:
Timestamp:
03/20/08 02:16:16 (4 months ago)
Author:
mtredinnick
Message:

Fixed #6616 -- Added an is_ajax() method to HttpRequest that uses the de facto
standard header for detecting an XmlHttpRequest? call. Thanks, Daniel Lindsley.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/http/__init__.py

    r7257 r7334  
    8282    def is_secure(self): 
    8383        return os.environ.get("HTTPS") == "on" 
     84 
     85    def is_ajax(self): 
     86        return self.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest' 
    8487 
    8588    def _set_encoding(self, val):