Commit d62bd57f authored by Bas de Nooijer's avatar Bas de Nooijer

excluded post requests for postbigrequest plugin (nothing to convert to post...)

parent a297060d
......@@ -91,7 +91,9 @@ class Solarium_Plugin_PostBigRequest extends Solarium_Plugin_Abstract
public function postCreateRequest($query, $request)
{
$queryString = $request->getQueryString();
if (strlen($queryString) > $this->getMaxQueryStringLength()) {
if ($request->getMethod() == Solarium_Client_Request::METHOD_GET &&
strlen($queryString) > $this->getMaxQueryStringLength()) {
$request->setMethod(Solarium_Client_Request::METHOD_POST);
$request->setRawData($queryString);
$request->clearParams();
......
......@@ -90,4 +90,16 @@ class Solarium_Plugin_PostBigRequestTest extends PHPUnit_Framework_TestCase
$this->assertEquals($requestInput, $requestOutput);
}
public function testPostCreateRequestUnalteredPostRequest()
{
$query = $this->_client->createUpdate();
$query->addDeleteById(1);
$requestOutput = $this->_client->createRequest($query);
$requestInput = clone $requestOutput;
$this->_plugin->postCreateRequest($query, $requestOutput);
$this->assertEquals($requestInput, $requestOutput);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment