Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove getAjaxVersion().
It was very specific to prototype, which has a very low adoption rate
these days.

/**
 * testRequestClientTypes method
 *
 * @return void
 */
	public function testRequestClientTypes() {
		$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', '1.5');
		$this->assertEquals('1.5', $this->RequestHandler->getAjaxVersion());

		$this->RequestHandler->request->env('HTTP_X_REQUESTED_WITH', false);
		$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', false);
		$this->assertFalse($this->RequestHandler->getAjaxVersion());
	}
  • Loading branch information
markstory committed Jul 26, 2014
1 parent 6b9c4b6 commit 7818b37
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
11 changes: 0 additions & 11 deletions src/Controller/Component/RequestHandlerComponent.php
Expand Up @@ -355,17 +355,6 @@ public function isWap() {
return $this->prefers('wap');
}

/**
* Gets Prototype version if call is Ajax, otherwise empty string.
* The Prototype library sets a special "Prototype version" HTTP header.
*
* @return string|bool When Ajax the prototype version of component making the call otherwise false
*/
public function getAjaxVersion() {
$httpX = $this->request->env('HTTP_X_PROTOTYPE_VERSION');
return ($httpX === null) ? false : $httpX;
}

/**
* Determines which content types the client accepts. Acceptance is based on
* the file extension parsed by the Router (if present), and by the HTTP_ACCEPT
Expand Down
Expand Up @@ -604,20 +604,6 @@ public function testRenderAsCalledTwice() {
$this->assertEquals('js', $this->Controller->layoutPath);
}

/**
* testRequestClientTypes method
*
* @return void
*/
public function testRequestClientTypes() {
$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', '1.5');
$this->assertEquals('1.5', $this->RequestHandler->getAjaxVersion());

$this->RequestHandler->request->env('HTTP_X_REQUESTED_WITH', false);
$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', false);
$this->assertFalse($this->RequestHandler->getAjaxVersion());
}

/**
* testRequestContentTypes method
*
Expand Down

0 comments on commit 7818b37

Please sign in to comment.