Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added isAjax property to Request class.
  • Loading branch information
KrisJordan committed Jun 9, 2009
1 parent eec7c4b commit be9fdde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions recess/recess/http/Environment.class.php
Expand Up @@ -37,7 +37,6 @@ public static function getRawRequest() {
} else {
$request->put = self::getPutParameters($request->input);
}

}

$request->headers = self::getHttpRequestHeaders();
Expand All @@ -50,10 +49,9 @@ public static function getRawRequest() {

$request->cookies = $_COOKIE;

// TODO: isAjax?, from django
// def is_ajax(self):
// return self.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest'

$request->isAjax = isset($request->headers['X_REQUESTED_WITH'])
&& $request->headers['X_REQUESTED_WITH'] == 'XMLHttpRequest';

return $request;
}

Expand Down
1 change: 1 addition & 0 deletions recess/recess/http/Request.class.php
Expand Up @@ -18,6 +18,7 @@ class Request {
public $resourceParts = array();
public $method;
public $input;
public $isAjax = false;

public $get = array();
public $post = array();
Expand Down

0 comments on commit be9fdde

Please sign in to comment.