diff --git a/public/API/graphql.php b/public/API/graphql.php index b778f21a64d014ea29aaeb3a9e3897ff2842c477..84ee93962e7e041938ce710c2be04f027ec85b85 100644 --- a/public/API/graphql.php +++ b/public/API/graphql.php @@ -1,6 +1,7 @@ <?php use GraphQL\Server\StandardServer; use GraphQL\Type\Schema; +use GraphQL\Error\DebugFlag; require 'vendor/autoload.php'; require "./lib/config.php"; @@ -17,7 +18,8 @@ try { 'schema' => $schema, 'rootValue' => [ 'db' =>$conn, - ] + ], + 'debugFlag' => DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE, ]; $server = new StandardServer($serverConfig); diff --git a/public/API/queries/skills.php b/public/API/queries/skills.php index 93b00deb9110dfe9be1c593ba89ef6421abc9499..a9b9f471d12038a0a41a804a63c1eede991c2d9f 100644 --- a/public/API/queries/skills.php +++ b/public/API/queries/skills.php @@ -28,7 +28,11 @@ function getSkills() { // Get the actual presigned-url $downloadURL = (string) $presignedRequest->getUri(); - array_push($response, $downloadURL); + $encodedUrl = rtrim(strtr(base64_encode($downloadURL), '+/', '-_'), '='); + $path = "/rs:fit:0:80:1/g:no/{$encodedUrl}.png"; + + $signature = rtrim(strtr(base64_encode(hash_hmac('sha256', $imgProxySalt.$path, $imgProxyKey, true)), '+/', '-_'), '='); + array_push($response, $imgProxyUrl . "/" . $signature . $path); } return $response; }