Skip to content

Commit 7818b37

Browse files
committed
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()); }
1 parent 6b9c4b6 commit 7818b37

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

src/Controller/Component/RequestHandlerComponent.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -355,17 +355,6 @@ public function isWap() {
355355
return $this->prefers('wap');
356356
}
357357

358-
/**
359-
* Gets Prototype version if call is Ajax, otherwise empty string.
360-
* The Prototype library sets a special "Prototype version" HTTP header.
361-
*
362-
* @return string|bool When Ajax the prototype version of component making the call otherwise false
363-
*/
364-
public function getAjaxVersion() {
365-
$httpX = $this->request->env('HTTP_X_PROTOTYPE_VERSION');
366-
return ($httpX === null) ? false : $httpX;
367-
}
368-
369358
/**
370359
* Determines which content types the client accepts. Acceptance is based on
371360
* the file extension parsed by the Router (if present), and by the HTTP_ACCEPT

tests/TestCase/Controller/Component/RequestHandlerComponentTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -604,20 +604,6 @@ public function testRenderAsCalledTwice() {
604604
$this->assertEquals('js', $this->Controller->layoutPath);
605605
}
606606

607-
/**
608-
* testRequestClientTypes method
609-
*
610-
* @return void
611-
*/
612-
public function testRequestClientTypes() {
613-
$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', '1.5');
614-
$this->assertEquals('1.5', $this->RequestHandler->getAjaxVersion());
615-
616-
$this->RequestHandler->request->env('HTTP_X_REQUESTED_WITH', false);
617-
$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', false);
618-
$this->assertFalse($this->RequestHandler->getAjaxVersion());
619-
}
620-
621607
/**
622608
* testRequestContentTypes method
623609
*

0 commit comments

Comments
 (0)