From 376f3542d2cd740401e03344a660003bd3c077eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Blaise=20de=20Carn=C3=A9?= Date: Thu, 26 Jul 2018 16:22:57 +0200 Subject: [PATCH 1/3] fix graphql endpoint --- docker/app/www/index.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/docker/app/www/index.php b/docker/app/www/index.php index caeac25..bd7173d 100644 --- a/docker/app/www/index.php +++ b/docker/app/www/index.php @@ -5,16 +5,24 @@ header('Access-Control-Allow-Credentials: true', true); header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Headers: Content-Type'); -if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { - return; +$payload = null; + +switch($_SERVER['REQUEST_METHOD']) { + case "POST": + if (isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] === 'application/json') { + $rawBody = file_get_contents('php://input'); + $requestData = json_decode($rawBody ?: '', true); + } else { + $requestData = $_POST; + } + break; + case "GET": + $requestData = $_GET; + break; + default: + exit; } -if (isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] === 'application/json') { - $rawBody = file_get_contents('php://input'); - $requestData = json_decode($rawBody ?: '', true); -} else { - $requestData = $_POST; -} $payload = isset($requestData['query']) ? $requestData['query'] : null; require_once __DIR__.'/../vendor/autoload.php'; From 20f4bd2fad06f80d4e58ef8504e72cd3f18ef224 Mon Sep 17 00:00:00 2001 From: Quentin DELCOURTE Date: Fri, 19 Oct 2018 19:42:23 +0200 Subject: [PATCH 2/3] Composer Installer auto-version SHA --- docker/Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 91dbbcf..f83c331 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,7 @@ FROM php MAINTAINER Conjecto RUN apt-get update && apt-get install -y \ - --no-install-recommends git zip zlib1g-dev + --no-install-recommends git zip zlib1g-dev wget RUN docker-php-ext-install -j$(nproc) zip @@ -11,12 +11,14 @@ WORKDIR /var/app/ # install composer RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" -RUN php composer-setup.php -RUN php -r "unlink('composer-setup.php');" +RUN \ + EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) && \ + php -r "if (hash_file('SHA384', 'composer-setup.php') === '${EXPECTED_SIGNATURE}') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ + php composer-setup.php && \ + php -r "unlink('composer-setup.php');" # install vendors RUN php composer.phar install # run server -CMD ["php", "-S", "0.0.0.0:80", "-t", "/var/app/www"] \ No newline at end of file +CMD ["php", "-S", "0.0.0.0:80", "-t", "/var/app/www"] From b4f11c322e399cf2da9464ecf04c80e7f991e497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Blaise=20de=20Carn=C3=A9?= Date: Mon, 22 Oct 2018 15:48:02 +0200 Subject: [PATCH 3/3] update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02b58cb..c316675 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ Tous les changements notables apportés à ce projet seront documentés dans ce Le format est basé sur [Keep a Changelog](http://keepachangelog.com/fr/1.0.0/) et ce projet adhère à [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.0.1] - 2018-10-22 + +### Corrections +- Composer Installer auto-version SHA (thanks to @delcourq) +- Fix GraphQL endpoint to handle GET request + ## [1.0.0] - 2018-04-24 ### Ajouts