<commit_before><?php
declare(strict_types=1);

namespace LotGD\Crate\GraphQL\AppBundle\Controller;

use DateTime;

use Overblog\GraphQLBundle\Controller\GraphController as OverblogGraphController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\{
    JsonResponse, Request, Response
};

use LotGD\Crate\GraphQL\Models\ApiKey;
use LotGD\Crate\GraphQL\Models\UserInterface;

/**
 * Controller for the GraphQL endpoint and the default landing page.
 */
class GraphController extends OverblogGraphController implements ContainerAwareInterface
{
    use ContainerAwareTrait;

    /**
     * Main controller action.
     * 
     * This method either displays a landing page informing the user that this is
     * a graphql interface or submits the query to the real controller that manages
     * graphql queries.
     * @Route("/")
     * @param Request $request
     * @return Response
     */
    public function endpointAction(Request $request, $schemaName = null): Response
    {
        $response = parent::endpointAction($request, $schemaName);
        $response->headers->set("Access-Control-Allow-Headers", "Content-Type, X-Lotgd-Auth-Token");<commit_msg>Finalized CORS support for http client.<commit_after><?php
declare(strict_types=1);

namespace LotGD\Crate\GraphQL\AppBundle\Controller;

use DateTime;

use Overblog\GraphQLBundle\Controller\GraphController as OverblogGraphController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\{
    JsonResponse, Request, Response
};

use LotGD\Crate\GraphQL\Models\ApiKey;
use LotGD\Crate\GraphQL\Models\UserInterface;

/**
 * Controller for the GraphQL endpoint and the default landing page.
 */
class GraphController extends OverblogGraphController implements ContainerAwareInterface
{
    use ContainerAwareTrait;

    /**
     * Main controller action.
     * 
     * This method either displays a landing page informing the user that this is
     * a graphql interface or submits the query to the real controller that manages
     * graphql queries.
     * @Route("/")
     * @param Request $request
     * @return Response
     */
    public function endpointAction(Request $request, $schemaName = null): Response
    {
        if ($request->getMethod() == "OPTIONS") {
            $response = new JsonResponse();
        } else {
            $response = parent::endpointAction($request, $schemaName);
        }

        $response->headers->set("Access-Control-Allow-Method", "GET, POST, OPTIONS");
        $response->headers->set("Access-Control-Allow-Headers", "Content-Type, X-Lotgd-Auth-Token, x_lotgd_auth_token");
{'fraction_non_alphanumeric': 0.09614126880313931, 'fraction_numerical': 0.0006540222367560497, 'mean_word_length': 4.256013745704467, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3007848', 'n_tokens_mistral': 825, 'n_tokens_neox': 813, 'n_words': 206}