Skip to content

Commit

Permalink
Merge pull request #52 from codebendercc/libtest-fix
Browse files Browse the repository at this point in the history
Put back HTTP header checks used in library tests
  • Loading branch information
fpapadopou committed Jul 18, 2016
2 parents b325d59 + 97ba213 commit 7f01d36
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -63,13 +63,24 @@ public function indexAction($authorizationKey, $version)
]);
}

$request = $this->getRequest()->getContent();
$requestObject = $this->getRequest();
$request = $requestObject->getContent();
if ($version == 'v1') {
// Custom headers used during library tests.
// They don't affect the compiler's response and make our life easier.
if ($requestObject->headers->get('X-Set-Exec-Time') == 'true') {
ini_set('max_execution_time', '30');
}
$mongoProjectId = $requestObject->headers->get('X-Mongo-Id');

//Get the compiler service
/** @var CompilerHandler $compiler */
$compiler = $this->get('compiler_handler');

$reply = $compiler->main($request, $params);
if ($mongoProjectId != '') {
$reply['mongo-id'] = $mongoProjectId;
}

return new JsonResponse($reply);
}
Expand Down

0 comments on commit 7f01d36

Please sign in to comment.